Skip to content

[wasm][coreCLR] Enable runtime tests that need relinking, and cover the call-helpers generator end to end #133187

Description

@radekdoulik

Once #131877 lands, src/tests tests whose managed code calls their own native code can be relinked into a test-specific corerun on browser-wasm. Two follow-ups:

1. Enable the tests

264 test projects have a CMakeProjectReference, 102 of them under src/tests/Interop. Work out how many actually pass once relinking is available, enable those, and track the rest.

Note there does not appear to be a CI leg running src/tests on browser-wasm CoreCLR today — CLR_R2R_Tests_browser_wasm runs ILCompiler.ReadyToRun.Tests, not the runtime tests — so this may also mean adding one.

2. Cover the call-helpers generator end to end

#131877 initially added unit tests that asserted substrings in the generated C, and dropped them again after this review comment. Two behaviours are consequently shipping without any test:

  • floating point callback arguments — a reverse thunk passes each argument to the interpreter in an 8-byte slot, and casting a float/double to the slot type converts it numerically instead of preserving its bits. Fixed in 23c2f38; an [UnmanagedCallersOnly] callback taking a double, called from native code, would cover it.
  • multi-assembly input — the generator has to accept a whole app closure, not one assembly. Any relinked test with more than one assembly exercises this incidentally.

If the enabled interop tests already cover these shapes, no new test is needed — check before adding.

Note

This issue was drafted with GitHub Copilot.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions