Skip to content

Add the missing SwitchTests.ilproj to ILVerification.Tests - #135917

Merged
jkotas merged 1 commit into
dotnet:mainfrom
pcshrosbree:test/ilverify-switch-tests
Oct 16, 2026
Merged

jkotas merged 1 commit into
dotnet:mainfrom
pcshrosbree:test/ilverify-switch-tests

Conversation

@pcshrosbree

Copy link
Copy Markdown
Contributor

Problem: ILVerification.Tests uses ILTests\*.ilproj to assemble its IL test cases (ILVerification.Tests.csproj:20). It then finds the test methods by name in the resulting assemblies in Tests\. ILTests/SwitchTests.il is the only .il file there without a matching .ilproj, so its ten switch test 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 to ShiftTests.ilproj and the other test projects that need no extra options.

Validation

I used main at 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 to SwitchTests.il to show that the newly included cases run and can fail. These edits are not part of this change.

Tree Result (passed/total)
main unchanged 484/484
this change 494/494
this change, Switch.Int32Value_Valid using ldnull as the switch value 493/494; Switch.Int32Value fails with StackUnexpected
this change, Switch.IntoTryMiddle expecting BranchOutOfTry 493/494; Switch.IntoTryMiddle fails; the actual error is BranchIntoTry

All ten newly included cases pass. For each row, I ran these commands (shown without nice -n 10 and 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=false

Note

This PR was prepared with AI assistance (Anthropic Claude and OpenAI Codex), under my direction. I reviewed it before posting.

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.
@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Oct 16, 2026
@azure-pipelines

Copy link
Copy Markdown
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.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jkotas
jkotas enabled auto-merge (squash) October 16, 2026 07:15
@jkotas jkotas added area-Tools-ILVerification Issues related to ilverify tool and IL verification in general and removed area-Infrastructure labels Oct 16, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @dotnet/jit-contrib
See info in area-owners.md if you want to be subscribed.

@jkotas

jkotas commented Oct 16, 2026

Copy link
Copy Markdown
Member

/ba-g known failures that are being worked on

@jkotas
jkotas merged commit 9cb1b23 into dotnet:main Oct 16, 2026
118 of 121 checks passed
@pcshrosbree

Copy link
Copy Markdown
Contributor Author

Thank you for the review and merge!

@pcshrosbree
pcshrosbree deleted the test/ilverify-switch-tests branch October 17, 2026 03:21
@dotnet-milestone-bot dotnet-milestone-bot Bot added this to the 12.0-preview1 milestone Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Tools-ILVerification Issues related to ilverify tool and IL verification in general community-contribution Indicates that the PR has been added by a community member

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants