Repository navigation
Add the missing SwitchTests.ilproj to ILVerification.Tests - #135917
Merged
Merged
Conversation
SwitchTests.il in ILVerification.Tests has no project file, so its ten switch test methods are never assembled or run. Every other .il file in ILTests has a matching .ilproj. SwitchTests.il was left out when the per-file projects were added in dotnet/corert#6307. Add SwitchTests.ilproj, identical to ShiftTests.ilproj and the other test projects that need no extra options. All ten tests pass.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
|
Tagging subscribers to this area: @dotnet/runtime-infrastructure |
jkotas
enabled auto-merge (squash)
October 16, 2026 07:15
Contributor
|
Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib |
This was referenced Oct 16, 2026
Open
Closed
Member
|
/ba-g known failures that are being worked on |
Contributor
Author
|
Thank you for the review and merge! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
ILVerification.TestsusesILTests\*.ilprojto assemble its IL test cases (ILVerification.Tests.csproj:20). It then finds the test methods by name in the resulting assemblies inTests\.ILTests/SwitchTests.ilis the only.ilfile there without a matching.ilproj, so its tenswitchtest methods are never assembled and never run. The file was left out when dotnet/corert#6307 added the per-file projects in 2018, and it has had no project in this repo since ILVerify moved here in #35038.Fix: I added
SwitchTests.ilproj, identical toShiftTests.ilprojand the other test projects that need no extra options.Validation
I used
mainat 1d7bc42 as the base, with linux-x64 and SDK 11.0.100-rc.1.26420.103. For the last two rows, I made temporary one-line edits toSwitchTests.ilto show that the newly included cases run and can fail. These edits are not part of this change.mainunchangedSwitch.Int32Value_Validusingldnullas the switch valueSwitch.Int32Valuefails withStackUnexpectedSwitch.IntoTryMiddleexpectingBranchOutOfTrySwitch.IntoTryMiddlefails; the actual error isBranchIntoTryAll ten newly included cases pass. For each row, I ran these commands (shown without
nice -n 10and the test command's TRX logger option):./dotnet.sh build src/coreclr/tools/ILVerification.Tests/ILVerification.Tests.csproj -c Release -m:4 /p:NuGetAudit=false ./dotnet.sh test src/coreclr/tools/ILVerification.Tests/ILVerification.Tests.csproj -c Release --no-build /p:NuGetAudit=falseNote
This PR was prepared with AI assistance (Anthropic Claude and OpenAI Codex), under my direction. I reviewed it before posting.