Skip to content

Convert .data tls IL tests to C++/CLI - #133533

Open
jkoritzinsky wants to merge 4 commits into
dotnet:mainfrom
jkoritzinsky:jkoritzinsky-urban-umbrella
Open

jkoritzinsky wants to merge 4 commits into
dotnet:mainfrom
jkoritzinsky:jkoritzinsky-urban-umbrella

Conversation

@jkoritzinsky

@jkoritzinsky jkoritzinsky commented Sep 9, 2026 •

Copy link
Copy Markdown
Member

Converts the four active tests using .data tls IL declarations to C++/CLI, following the IJW/C++CLI patterns established under src/tests/Interop:

  • JIT/Directed/tls/Test-TLS
  • JIT/Directed/tls/MutualRecurThd-TLS
  • JIT/Regression/CLR-x86-JIT/V1.2-M01/b03689
  • `JIT/Regression/CLR-x86-EJIT/v1-m10/b07847

Converts the tests over to C++/CLI as all of these tests are really testing C++/CLI scenarios that we only support via C++/CLI.

Changes

  • Moved the shared native-runtime dependency copy support from src/tests/Interop/Directory.Build.targets into src/tests/Directory.Build.targets so it can be reused outside the Interop tree; kept the Interop-only TestLibraryProjectPath override in Interop/Directory.Build.props.
  • Added CMakeLists.txt/.cpp native C++/CLI projects and .cs/.csproj managed wrappers for each test.
  • Native TLS storage uses file-scope __declspec(thread) globals under #pragma unmanaged/#pragma managed.
  • Managed wrappers invoke the native static entry points via UnsafeAccessor/UnsafeAccessorType rather than reflection.
  • Updated Directed_ro.csproj merged-test references from .ilproj to .csproj.

Note

This PR was created with assistance from GitHub Copilot.

Convert the four active tests using .data tls IL declarations
(JIT/Directed/tls/Test-TLS, JIT/Directed/tls/MutualRecurThd-TLS,
JIT/Regression/CLR-x86-JIT/V1.2-M01/b03689,
JIT/Regression/CLR-x86-EJIT/v1-m10/b07847) to C++/CLI, following the
IJW/C++CLI patterns established under src/tests/Interop.

- Move the shared native-runtime dependency copy support from
  src/tests/Interop/Directory.Build.targets into
  src/tests/Directory.Build.targets so it can be reused outside the
  Interop tree; keep the Interop-only TestLibraryProjectPath override in
  Interop/Directory.Build.props.
- Add CMakeLists.txt/.cpp native C++/CLI projects and .cs/.csproj managed
  wrappers for each test.
- Native TLS storage uses file-scope __declspec(thread) globals under
  #pragma unmanaged/managed.
- Managed wrappers invoke the native static entry points via
  UnsafeAccessor/UnsafeAccessorType rather than reflection.
- Update Directed_ro.csproj merged-test references from .ilproj to
  .csproj.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@jkoritzinsky
jkoritzinsky force-pushed the jkoritzinsky-urban-umbrella branch from 8551d8a to 8c18482 Compare September 9, 2026 20:24
@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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new IJW test projects should be aligned with existing IJW compatibility flags and should be gated for Checked builds to avoid the known Checked-build crash described in the PR.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 4 High severity

New issues introduced by this change (4)
Severity Finding
High severity src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.csproj — This IJW/C++/CLI-backed test project should carry the same IJW-specific flags as other IJW tests…
High severity src/​tests/​JIT/​Directed/​tls/​Test-TLS.csproj — This new IJW/C++/CLI-backed test project is missing the IJW-specific test properties used elsewhere…
High severity src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.csproj — This IJW/C++/CLI-backed test project should match the standard IJW test flags…
High severity src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.csproj — This new IJW/C++/CLI-backed test project is missing the standard IJW test properties…
What changed in this PR

This PR migrates several JIT TLS tests from IL (.data tls) to Windows-only IJW/C++/CLI-based implementations, and adjusts the test build infrastructure so the IJW dependency-copying logic can be reused outside src/tests/Interop.

Changes:

  • Replaces four .ilproj TLS tests with managed wrappers (.cs/.csproj) that invoke C++/CLI implementations built via CMake IJW projects.
  • Adds new IJW/C++/CLI CMake projects and sources for the converted tests (including __declspec(thread) TLS globals).
  • Moves the “copy Debug CRT/UCRT dependencies for IJW builds” MSBuild target from src/tests/Interop/Directory.Build.targets to src/tests/Directory.Build.targets, and shifts the Interop TestLibrary reference to Interop/Directory.Build.props.
File Description
src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​CMakeLists.txt Adds Windows-only IJW CMake build for B03689Native.
src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.ilproj Removes IL test project.
src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.il Removes IL test body using .data tls.
src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.csproj Adds managed wrapper project referencing IJW native build.
src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.cs Adds wrapper invoking native TlsTest.Test via UnsafeAccessor.
src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.cpp Adds IJW/C++/CLI implementation using __declspec(thread).
src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​CMakeLists.txt Adds Windows-only IJW CMake build for B07847Native.
src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.ilproj Removes IL test project.
src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.il Removes IL test body using .data tls.
src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.csproj Adds managed wrapper project referencing IJW native build.
src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.cs Adds wrapper invoking native TlsTest.Test via UnsafeAccessor.
src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.cpp Adds IJW/C++/CLI implementation using __declspec(thread).
src/​tests/​JIT/​Directed/​tls/​test-tls.ilproj Removes IL test project.
src/​tests/​JIT/​Directed/​tls/​Test-TLS.il Removes IL test body using .data tls.
src/​tests/​JIT/​Directed/​tls/​Test-TLS.csproj Adds managed wrapper project referencing IJW native build.
src/​tests/​JIT/​Directed/​tls/​Test-TLS.cs Adds wrapper invoking native TlsTest.Test via UnsafeAccessor.
src/​tests/​JIT/​Directed/​tls/​mutualrecurthd-tls.ilproj Removes IL test project.
src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.il Removes large IL test body using .data tls and threaded recursion.
src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.csproj Adds managed wrapper project referencing IJW native build.
src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.cs Adds managed thread harness invoking native Thread_EA.Run via UnsafeAccessor.
src/​tests/​JIT/​Directed/​tls/​cppcli/​TestTLSNative.cpp Adds IJW/C++/CLI TLS implementation for Test-TLS.
src/​tests/​JIT/​Directed/​tls/​cppcli/​CMakeLists.txt Adds IJW CMake project for TestTLSNative.
src/​tests/​JIT/​Directed/​tls/​cppcli-mutual/​MutualRecurThd-TLS.cpp Adds IJW/C++/CLI implementation of the threaded mutual recursion test.
src/​tests/​JIT/​Directed/​tls/​cppcli-mutual/​CMakeLists.txt Adds IJW CMake project for MutualRecurThdTLSNative.
src/​tests/​JIT/​Directed/​tls/​CMakeLists.txt Wires in the new IJW subdirectories on Windows hosts.
src/​tests/​JIT/​Directed/​Directed_ro.csproj Switches merged references from .ilproj to the new .csproj wrappers.
src/​tests/​Interop/​Directory.Build.targets Removes Interop-local targets (logic moved to broader scope).
src/​tests/​Interop/​Directory.Build.props Moves Interop TestLibrary reference logic into props.
src/​tests/​Directory.Build.targets Adds reusable CopyInteropNativeRuntimeDependencies target for IJW builds.

Comment thread src/tests/JIT/Directed/tls/MutualRecurThd-TLS.csproj
Comment thread src/tests/JIT/Directed/tls/Test-TLS.csproj
Comment thread src/tests/JIT/Regression/CLR-x86-EJIT/v1-m10/b07847/b07847.csproj
Comment thread src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b03689/b03689.csproj
Comment thread src/tests/JIT/Regression/CLR-x86-EJIT/v1-m10/b07847/b07847.cpp
Comment thread src/tests/JIT/Regression/CLR-x86-JIT/V1.2-M01/b03689/b03689.cpp Outdated
Comment thread src/tests/JIT/Directed/tls/cppcli/TestTLSNative.cpp Outdated
Comment thread src/tests/JIT/Directed/tls/cppcli/TestTLSNative.cpp
- Add standard IJW test flags (UnloadabilityIncompatible,
  IlasmRoundTripIncompatible) to all four converted TLS test projects,
  matching src/tests/Interop/IJW/Directory.Build.props conventions.
- Skip all four tests on Checked CoreCLR builds via
  [SkipOnCoreClr(..., RuntimeConfiguration.Checked)], tracking the
  __declspec(thread)/IJW JIT assertion as dotnet#133538. Add the
  required TestLibraryProjectPath ProjectReference so the
  TestLibrary.CoreClrConfigurationDetection condition compiles for these
  non-merged test projects.
- Remove the ineffective '#pragma unmanaged'/'#pragma managed' wrapping
  around the __declspec(thread) TLS variable declarations: those pragmas
  only affect function code generation, not data declarations, so they
  had no effect.
- Mark s_tlsFieldData 'volatile' in Test-TLS/b03689/b07847's native TLS
  globals so the compiler emits the same ldsfld/stsfld access pattern as
  the original IL tests instead of optimizing away the redundant
  load/store sequence.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 9, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The new IJW/C++/CLI TLS native files do not follow the established IJW #pragma unmanaged/#pragma managed separation pattern (and the PR description claims they do), so the native/managed boundary intent is currently inconsistent and should be made explicit.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Review tier: Lite
Findings: 1 Low severity

New issues introduced by this change (1)
Severity Finding
Low severity src/​tests/​JIT/​Directed/​tls/​cppcli/​TestTLSNative.cpp — The PR description says TLS storage uses file-scope __declspec(thread) under `#pragma…
Issues resolved since last review (4)
Severity Finding
High severity src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.csproj — This new IJW/C++/CLI-backed test project is missing the standard IJW test properties… View resolved comment
High severity src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.csproj — This IJW/C++/CLI-backed test project should match the standard IJW test flags… View resolved comment
High severity src/​tests/​JIT/​Directed/​tls/​Test-TLS.csproj — This new IJW/C++/CLI-backed test project is missing the IJW-specific test properties used elsewhere… View resolved comment
High severity src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.csproj — This IJW/C++/CLI-backed test project should carry the same IJW-specific flags as other IJW tests… View resolved comment

Comment thread src/tests/JIT/Directed/tls/cppcli/TestTLSNative.cpp Outdated
@MichalStrehovsky

Copy link
Copy Markdown
Member

I'm not sure whether touching these tests in a situation where TLS doesn't work at all (#42187) and we can't test it is the best timing.

@jkoritzinsky

Copy link
Copy Markdown
Member Author

We haven't been running these tests for 8 years and the current IL tests are not representative of the scenario we actually support (we only support usage as C++/CLI generates it).

I wanted to move these over as we aren't adding support for this to managed ilasm as currently planned as this is the only supported scenario and pure C++/CLI isn't supported on CoreCLR.

@MichalStrehovsky

Copy link
Copy Markdown
Member

We haven't been running these tests for 8 years and the current IL tests are not representative of the scenario we actually support (we only support usage as C++/CLI generates it).

Right, but I assume the existing coverage was sufficient to ship the feature on .NET Framework.

This PR is doing careless changes to the existing coverage. The first iteration was off. The second iteration added __declspec(thread) volatile that is one of the least common things one can do in C++ yet 75% of our coverage is now that. All field accesses are now prefixed with volatile. prefix. If the tests under Regression were testing optimization misfiring, the volatile. prefix would definitely make sure optimizations don't misfire.

@MichalStrehovsky

Copy link
Copy Markdown
Member

(If we want to get rid of the IL, we should write brand new tests in C++ that test all the interesting patterns, I don't think just rewriting in nonsensical C++ that generates a different IL is a good strategy.)

#pragma optimize has no effect under /clr compilation (confirmed
experimentally: identical constant-folded IL with or without the
pragma when /O2 is in effect), so volatile is the only way to force
these tests to emit the real ldsfld/stsfld sequence they're meant to
exercise. Add a comment explaining this so it isn't mistaken for an
oversight in review.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 23, 2026 23:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

One or more issues must be addressed before approval.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)
Resolved since last review (1)
Previously missed (12)

In code that hasn't changed since last review

Medium severity Missing Mono guard allows unsupported Windows Mono execution

src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.cs:11

Because this project is outside Interop, it does not inherit the IJW/Mono guards used by the existing C++/CLI tests. CLRTestTargetUnsupported here only excludes non-Windows targets, while SkipOnCoreClr does not skip Mono, so this Fact can still run on Windows Mono even though C++/CLI/IJW is unsupported there. Add the standard Mono active-issue/platform guard (or an equivalent project-level Mono exclusion) before this test is enabled.

Medium severity CrossGenTest must be disabled for mixed-mode IJW project

src/​tests/​JIT/​Directed/​tls/​MutualRecurThd-TLS.csproj:3

All existing IJW/C++/CLI test projects set CrossGenTest to false (with the 83942 rationale), but this new mixed-mode project leaves the default enabled. The crossgen target runs whenever CrossGenTest is not false, so this project can enter the ReadyToRun pass even though its CMake IJW dependency is not crossgen-compatible; add the same property here.

Medium severity Missing Mono guard allows unsupported Windows Mono execution

src/​tests/​JIT/​Directed/​tls/​Test-TLS.cs:10

Because this project is outside Interop, it does not inherit the IJW/Mono guards used by the existing C++/CLI tests. CLRTestTargetUnsupported here only excludes non-Windows targets, while SkipOnCoreClr does not skip Mono, so this Fact can still run on Windows Mono even though C++/CLI/IJW is unsupported there. Add the standard Mono active-issue/platform guard (or an equivalent project-level Mono exclusion) before this test is enabled.

Medium severity CrossGenTest must be disabled for mixed-mode IJW project

src/​tests/​JIT/​Directed/​tls/​Test-TLS.csproj:3

All existing IJW/C++/CLI test projects set CrossGenTest to false (with the 83942 rationale), but this new mixed-mode project leaves the default enabled. The crossgen target runs whenever CrossGenTest is not false, so this project can enter the ReadyToRun pass even though its CMake IJW dependency is not crossgen-compatible; add the same property here.

Medium severity Native TLS global lacks unmanaged pragma boundaries

src/​tests/​JIT/​Directed/​tls/​cppcli-mutual/​MutualRecurThd-TLS.cpp:8

The native TLS global is not bracketed by #pragma unmanaged/#pragma managed, unlike the existing IJW sources and the repro tracked in #133538. That leaves the compiler mode implicit and does not guarantee the global is emitted and accessed as the native __declspec(thread) storage this conversion is intended to test; add the unmanaged/managed boundary around the global before the managed function.

Medium severity Native TLS global lacks unmanaged pragma boundaries

src/​tests/​JIT/​Directed/​tls/​cppcli/​TestTLSNative.cpp:10

The native TLS global is not bracketed by #pragma unmanaged/#pragma managed, unlike the existing IJW sources and the repro tracked in #133538. That leaves the compiler mode implicit and does not guarantee the global is emitted and accessed as the native __declspec(thread) storage this conversion is intended to test; add the unmanaged/managed boundary around the global and before the managed class.

Medium severity Native TLS global lacks unmanaged pragma boundaries

src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.cpp:10

The native TLS global is not bracketed by #pragma unmanaged/#pragma managed, unlike the existing IJW sources and the repro tracked in #133538. That leaves the compiler mode implicit and does not guarantee the global is emitted and accessed as the native __declspec(thread) storage this conversion is intended to test; add the unmanaged/managed boundary around the global and before the managed class.

Medium severity Missing Mono guard allows unsupported Windows Mono execution

src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.cs:10

Because this project is outside Interop, it does not inherit the IJW/Mono guards used by the existing C++/CLI tests. CLRTestTargetUnsupported here only excludes non-Windows targets, while SkipOnCoreClr does not skip Mono, so this Fact can still run on Windows Mono even though C++/CLI/IJW is unsupported there. Add the standard Mono active-issue/platform guard (or an equivalent project-level Mono exclusion) before this test is enabled.

Medium severity CrossGenTest must be disabled for mixed-mode IJW project

src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.csproj:3

All existing IJW/C++/CLI test projects set CrossGenTest to false (with the 83942 rationale), but this new mixed-mode project leaves the default enabled. The crossgen target runs whenever CrossGenTest is not false, so this project can enter the ReadyToRun pass even though its CMake IJW dependency is not crossgen-compatible; add the same property here.

Medium severity Native TLS global lacks unmanaged pragma boundaries

src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.cpp:10

The native TLS global is not bracketed by #pragma unmanaged/#pragma managed, unlike the existing IJW sources and the repro tracked in #133538. That leaves the compiler mode implicit and does not guarantee the global is emitted and accessed as the native __declspec(thread) storage this conversion is intended to test; add the unmanaged/managed boundary around the global and before the managed class.

Medium severity Missing Mono guard allows unsupported Windows Mono execution

src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.cs:10

Because this project is outside Interop, it does not inherit the IJW/Mono guards used by the existing C++/CLI tests. CLRTestTargetUnsupported here only excludes non-Windows targets, while SkipOnCoreClr does not skip Mono, so this Fact can still run on Windows Mono even though C++/CLI/IJW is unsupported there. Add the standard Mono active-issue/platform guard (or an equivalent project-level Mono exclusion) before this test is enabled.

Medium severity CrossGenTest must be disabled for mixed-mode IJW project

src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.csproj:3

All existing IJW/C++/CLI test projects set CrossGenTest to false (with the 83942 rationale), but this new mixed-mode project leaves the default enabled. The crossgen target runs whenever CrossGenTest is not false, so this project can enter the ReadyToRun pass even though its CMake IJW dependency is not crossgen-compatible; add the same property here.

Comment thread src/tests/Interop/Directory.Build.props
Add a shared disable_optimizations_for_directory() helper to IJW.cmake
that strips the inherited per-config optimization flag (e.g. /O2 for
Checked) from the directory's COMPILE_OPTIONS and replaces it with
/Od, so the compiler doesn't fold away the redundant loads/stores
these tests rely on. Just appending /Od without removing /O2 produces
a 'D9025: overriding /O2 with /Od' command-line warning.

This replaces the earlier 'volatile' workaround in TestTLSNative.cpp,
b03689.cpp, and b07847.cpp, which forced a '.volatile' IL prefix not
present in the original IL tests. With /Od applied at the CMake level,
these fields go back to being plain (non-volatile) __declspec(thread)
statics, and the generated IL now matches the original tests exactly.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 24, 2026 17:27
@jkoritzinsky

Copy link
Copy Markdown
Member Author

I've updated the tests to emit the matching IL to what the original .il files had.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🔵 Needs a closer look

One or more issues must be addressed before approval.

Review effort: Lite
Findings: None

Resolved since last review (1)
Previously missed (5)

In code that hasn't changed since last review

Medium severity Add unmanaged and managed boundaries for native TLS repro

src/​tests/​JIT/​Directed/​tls/​cppcli-mutual/​MutualRecurThd-TLS.cpp:6

The native TLS repro for this conversion is explicitly a file-scope __declspec(thread) declaration in an unmanaged region followed by a managed region; this source omits both pragmas. Add the unmanaged/managed boundary so the test reliably exercises the native IJW TLS code path described by #133538, rather than depending on the compiler's default mode.

This issue also appears on line 14 of the same file.

Medium severity Add unmanaged and managed boundaries for native TLS repro

src/​tests/​JIT/​Directed/​tls/​cppcli/​TestTLSNative.cpp:8

The native TLS repro for this conversion is explicitly a file-scope __declspec(thread) declaration in an unmanaged region followed by a managed region; this source omits both pragmas. Add the unmanaged/managed boundary so the test reliably exercises the native IJW TLS code path described by #133538, rather than depending on the compiler's default mode.

Medium severity Add unmanaged and managed boundaries for native TLS repro

src/​tests/​JIT/​Regression/​CLR-x86-EJIT/​v1-m10/​b07847/​b07847.cpp:8

The native TLS repro for this conversion is explicitly a file-scope __declspec(thread) declaration in an unmanaged region followed by a managed region; this source omits both pragmas. Add the unmanaged/managed boundary so the test reliably exercises the native IJW TLS code path described by #133538, rather than depending on the compiler's default mode.

Medium severity Add unmanaged and managed boundaries for native TLS repro

src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.cpp:8

The native TLS repro for this conversion is explicitly a file-scope __declspec(thread) declaration in an unmanaged region followed by a managed region; this source omits both pragmas. Add the unmanaged/managed boundary so the test reliably exercises the native IJW TLS code path described by #133538, rather than depending on the compiler's default mode.

Medium severity Disable CrossGenTest for IJW wrapper

src/​tests/​JIT/​Regression/​CLR-x86-JIT/​V1.2-M01/​b03689/​b03689.csproj:3

The existing C++/CLI/IJW test projects all set CrossGenTest to false (for example, src/tests/Interop/IJW/NativeVarargs/NativeVarargsTest.csproj:3) because mixed-mode tests are not compatible with crossgen2. Without the opt-out, this new IJW wrapper can enter the ReadyToRun test path and fail before exercising the TLS code; add the same property here and to the other three converted projects.

This branch has not been deployed

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

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants