Skip to content

Add basic test for crossgen2 WebCIL#128609

Open
jtschuster wants to merge 1 commit into
dotnet:mainfrom
jtschuster:jtschuster/webcil-r2r-test
Open

Add basic test for crossgen2 WebCIL#128609
jtschuster wants to merge 1 commit into
dotnet:mainfrom
jtschuster:jtschuster/webcil-r2r-test

Conversation

@jtschuster
Copy link
Copy Markdown
Member

Adds a super basic test to run a crossgen2 compilation and emit a WASM WebCIL payload.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR extends the ILCompiler.ReadyToRun test harness to support non-.dll crossgen2 outputs and adds a minimal xUnit test case that runs crossgen2 targeting wasm/browser to produce a WASM-wrapped WebCIL payload and validates it via WebcilImageReader.

Changes:

  • Add CrossgenCompilation.OutputFileExtension and use it when computing crossgen2 output paths.
  • Remove unused Crossgen2Option enum values and their argument mappings.
  • Add a new WebCIL test case source file plus a new xUnit test (WasmWebcilModule) that compiles/validates a .wasm WebCIL output.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCasesRunner/R2RTestRunner.cs Adds configurable output extension for crossgen2 output path generation (enables .wasm outputs).
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCasesRunner/R2RDriver.cs Removes unused crossgen2 option enum entries/mappings.
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/Webcil/WasmWebcilModule.cs New embedded-source test input used to produce a WebCIL payload.
src/coreclr/tools/aot/ILCompiler.ReadyToRun.Tests/TestCases/R2RTestSuites.cs Adds an xUnit test that invokes crossgen2 for wasm/browser and validates WebCIL-in-WASM output.

Comment on lines +111 to +115
/// <summary>
/// File extension for the crossgen2 output image.
/// </summary>
public string OutputFileExtension { get; init; } = ".dll";

Copy link
Copy Markdown
Contributor

@adamperlin adamperlin left a comment

Choose a reason for hiding this comment

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

This looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-crossgen2-coreclr only use for closed issues

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants