From 803a07721759d70dc36856579f278e269c0e5d1c Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Fri, 19 Sep 2025 12:50:04 -0700 Subject: [PATCH 01/18] Checkpoint changes to make interop suite run without crashing --- .../CoreClrConfigurationDetection.cs | 14 ++++++++++++-- .../XUnitWrapperGenerator/RuntimeTestModes.cs | 2 ++ .../XUnitWrapperGenerator/XUnitWrapperGenerator.cs | 4 ++++ src/tests/Interop/Interop.csproj | 6 ++++++ .../PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs | 3 +++ .../AssemblyTrue/AssemblyTrueTest.cs | 2 ++ .../AssemblyWithoutComVisibleTest.cs | 2 ++ .../Default/DefaultTest.cs | 2 ++ .../invalid_operations/ManagedPointers.cs | 5 ++++- 9 files changed, 37 insertions(+), 3 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs index 8b6d893f8d9714..fdbf0fe8e2cb14 100644 --- a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs @@ -23,8 +23,18 @@ public static class CoreClrConfigurationDetection public static bool IsTieredCompilation => string.Equals(GetEnvironmentVariableValue("TieredCompilation", "1"), "1", StringComparison.InvariantCulture); public static bool IsHeapVerify => string.Equals(GetEnvironmentVariableValue("HeapVerify"), "1", StringComparison.InvariantCulture); + public static bool IsInterpreterActive { + get { + if (!string.IsNullOrWhiteSpace(GetEnvironmentVariableValue("Interpreter", ""))) + return true; + if (int.TryParse(GetEnvironmentVariableValue("InterpMode", "0"), out int mode) && (mode > 0)) + return true; + return false; + } + } + public static bool IsGCStress => !string.Equals(GetEnvironmentVariableValue("GCStress"), "0", StringComparison.InvariantCulture); - + public static bool IsAnyJitStress => IsJitStress || IsJitStressRegs || IsJitMinOpts || IsTailCallStress; public static bool IsAnyJitOptimizationStress => IsAnyJitStress || IsTieredCompilation; @@ -58,4 +68,4 @@ private static bool CompareGCStressModeAsLower(string value, string first, strin string.Equals(value, "0xf", StringComparison.InvariantCulture) || string.Equals(value, "f", StringComparison.InvariantCulture); } -} \ No newline at end of file +} diff --git a/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs b/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs index f4d60288ca6e77..d2c3edc20e17e6 100644 --- a/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs +++ b/src/tests/Common/XUnitWrapperGenerator/RuntimeTestModes.cs @@ -43,5 +43,7 @@ public enum RuntimeTestModes AnyJitOptimizationStress = AnyJitStress | TieredCompilation, // Disable when any JIT non-full optimization stress mode is exercised. HeapVerify = 1 << 9, // DOTNET_HeapVerify (or COMPlus_HeapVerify) is set. + + InterpreterActive = 1 << 10, // DOTNET_Interpreter != "" or DOTNET_InterpMode != 0 } } diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs index 6f0e669dda18a3..cf0195d2c6bed1 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -936,6 +936,10 @@ private static ImmutableArray DecorateWithSkipOnCoreClrConfiguration( { conditions.Add($"!{ConditionClass}.IsHeapVerify"); } + if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.InterpreterActive)) + { + conditions.Add($"!{ConditionClass}.IsInterpreterActive"); + } if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.AnyGCStress)) { diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index b0762fcd2eeae9..b4ea0e85f7df82 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -22,10 +22,14 @@ + + @@ -42,7 +46,9 @@ + diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs index 9601a835bb79ac..b5a72d9fae9990 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs @@ -41,10 +41,12 @@ public static unsafe int StructWithCtorTest(StructWithCtor* ptrStruct, ref Struc return 100; } + /* [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsWindows))] [SkipOnMono("Not supported on Mono")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] [SkipOnCoreClr("JitStress can introduce extra copies", RuntimeTestModes.JitStress)] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static unsafe void ValidateCopyConstructorAndDestructorCalled() { CopyCtorUtil.TestDelegate del = (CopyCtorUtil.TestDelegate)Delegate.CreateDelegate(typeof(CopyCtorUtil.TestDelegate), typeof(CopyCtor).GetMethod("StructWithCtorTest")); @@ -56,4 +58,5 @@ public static unsafe void ValidateCopyConstructorAndDestructorCalled() GC.KeepAlive(del); } + */ } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs index 5b91576b75749e..d78d5380637319 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs @@ -640,6 +640,7 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// /// + /* [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("Requires COM support")] @@ -897,4 +898,5 @@ public static void RunComVisibleTests() Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } + */ } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs index 081a44e0ccf1f8..63dfc83eff216f 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs @@ -635,6 +635,7 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNotPublic_VisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); + /* /// /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// @@ -897,4 +898,5 @@ public static void RunComVisibleTests() Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } + */ } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs index 02252520217246..83293c62c6312b 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs @@ -700,6 +700,7 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNotPublic_VisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); + /* /// /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// @@ -1007,4 +1008,5 @@ public static void RunTestsInALC() { TestLibrary.Utilities.ExecuteAndUnload(typeof(ComVisibleServer).Assembly.Location, nameof(ComVisibleServer), nameof(RunComVisibleTests)); } + */ } diff --git a/src/tests/baseservices/invalid_operations/ManagedPointers.cs b/src/tests/baseservices/invalid_operations/ManagedPointers.cs index c5357cf03541e6..92668577427cfc 100644 --- a/src/tests/baseservices/invalid_operations/ManagedPointers.cs +++ b/src/tests/baseservices/invalid_operations/ManagedPointers.cs @@ -33,17 +33,20 @@ public static void Validate_GeneratedILStubs_NullByRef() { Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)}..."); { + Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)} case 1..."); var fptr = (delegate*unmanaged)(delegate*unmanaged)&PassByRef; Assert.Equal(0, fptr(ref Unsafe.NullRef())); } { + Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)} case 2..."); var fptr = (delegate*unmanaged)(delegate*unmanaged)&PassByRef; Assert.Equal(0, fptr(ref Unsafe.NullRef())); } Assert.Throws(() => { + Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)} case 3..."); var fptr = (delegate*unmanaged)(delegate*unmanaged)&PassByRef; fptr(ref Unsafe.NullRef()); }); @@ -81,4 +84,4 @@ public static void Validate_IntrinsicMethodsWithByRef_NullByRef() Assert.Throws(() => Interlocked.CompareExchange(ref Unsafe.NullRef(), new object(), new object())); Assert.Throws(() => Interlocked.CompareExchange(ref Unsafe.NullRef(), new object(), new object())); } -} \ No newline at end of file +} From 1d2b0f63f8df2aef2fbbcb7a86bdb7538e1ab652 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 22 Sep 2025 15:22:42 -0700 Subject: [PATCH 02/18] Use SkipOnCoreClrAttribute instead of commenting out --- .../Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs | 2 -- .../AssemblyTrue/AssemblyTrueTest.cs | 3 +-- .../AssemblyWithoutComVisibleTest.cs | 3 +-- .../NativeCallManagedComVisible/Default/DefaultTest.cs | 4 ++-- src/tests/baseservices/invalid_operations/ManagedPointers.cs | 4 +--- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs index b5a72d9fae9990..f58d45154616e5 100644 --- a/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs +++ b/src/tests/Interop/PInvoke/Miscellaneous/CopyCtor/CopyCtorTest.cs @@ -41,7 +41,6 @@ public static unsafe int StructWithCtorTest(StructWithCtor* ptrStruct, ref Struc return 100; } - /* [ConditionalFact(typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsWindows))] [SkipOnMono("Not supported on Mono")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] @@ -58,5 +57,4 @@ public static unsafe void ValidateCopyConstructorAndDestructorCalled() GC.KeepAlive(del); } - */ } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs index d78d5380637319..5809830ec0522b 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyTrue/AssemblyTrueTest.cs @@ -640,10 +640,10 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// /// - /* [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("Requires COM support")] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void RunComVisibleTests() { int fooSuccessVal = 0; @@ -898,5 +898,4 @@ public static void RunComVisibleTests() Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } - */ } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs index 63dfc83eff216f..d7709383fc1152 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/AssemblyWithoutComVisible/AssemblyWithoutComVisibleTest.cs @@ -635,7 +635,6 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNotPublic_VisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - /* /// /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// @@ -644,6 +643,7 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [ConditionalFact(typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNotNativeAot))] [PlatformSpecific(TestPlatforms.Windows)] [SkipOnMono("Requires COM support")] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void RunComVisibleTests() { int fooSuccessVal = 0; @@ -898,5 +898,4 @@ public static void RunComVisibleTests() Console.WriteLine("CCWTest_NestedInterfaceGenericVisibleTrue"); Assert.Equal(Helpers.E_NOINTERFACE, CCWTest_NestedInterfaceGenericVisibleTrue((object)nestedGenericServer, out fooSuccessVal)); } - */ } diff --git a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs index 83293c62c6312b..6aa743b51e90ec 100644 --- a/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs +++ b/src/tests/Interop/PInvoke/NativeCallManagedComVisible/Default/DefaultTest.cs @@ -700,12 +700,12 @@ public sealed class NestedClassGenericServer : INestedInterfaceVisibleTrue, I [DllImport("ComVisibleNative")] public static extern int CCWTest_NestedInterfaceNotPublic_VisibleTrue([MarshalAs(UnmanagedType.IUnknown)] object unk, out int fooSuccessVal); - /* /// /// Test case set for ComVisible. The assembly is set as [assembly: ComVisible(false)] /// /// [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void RunComVisibleTests() { int fooSuccessVal = 0; @@ -1004,9 +1004,9 @@ public static void RunComVisibleTests() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void RunTestsInALC() { TestLibrary.Utilities.ExecuteAndUnload(typeof(ComVisibleServer).Assembly.Location, nameof(ComVisibleServer), nameof(RunComVisibleTests)); } - */ } diff --git a/src/tests/baseservices/invalid_operations/ManagedPointers.cs b/src/tests/baseservices/invalid_operations/ManagedPointers.cs index 92668577427cfc..de45719fb73807 100644 --- a/src/tests/baseservices/invalid_operations/ManagedPointers.cs +++ b/src/tests/baseservices/invalid_operations/ManagedPointers.cs @@ -29,24 +29,22 @@ public static void Validate_BoxingHelpers_NullByRef() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void Validate_GeneratedILStubs_NullByRef() { Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)}..."); { - Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)} case 1..."); var fptr = (delegate*unmanaged)(delegate*unmanaged)&PassByRef; Assert.Equal(0, fptr(ref Unsafe.NullRef())); } { - Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)} case 2..."); var fptr = (delegate*unmanaged)(delegate*unmanaged)&PassByRef; Assert.Equal(0, fptr(ref Unsafe.NullRef())); } Assert.Throws(() => { - Console.WriteLine($"Running {nameof(Validate_GeneratedILStubs_NullByRef)} case 3..."); var fptr = (delegate*unmanaged)(delegate*unmanaged)&PassByRef; fptr(ref Unsafe.NullRef()); }); From d59db40b21a31224565957230268006dc077beda Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 24 Sep 2025 13:48:19 -0700 Subject: [PATCH 03/18] Uncomment broken sub-suites --- src/tests/Interop/Interop.csproj | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/tests/Interop/Interop.csproj b/src/tests/Interop/Interop.csproj index b4ea0e85f7df82..b0762fcd2eeae9 100644 --- a/src/tests/Interop/Interop.csproj +++ b/src/tests/Interop/Interop.csproj @@ -22,14 +22,10 @@ - - @@ -46,9 +42,7 @@ - From b88931232d64dd9136754068131fa8522f8deb2e Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 24 Sep 2025 13:48:26 -0700 Subject: [PATCH 04/18] Disable some tests on interpreter --- src/tests/Interop/COM/ComWrappers/API/Program.cs | 1 + src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.cs | 3 ++- src/tests/Interop/IDynamicInterfaceCastable/Program.cs | 2 ++ .../MarshalAPI/FunctionPointer/GenericFunctionPointer.cs | 5 +++-- src/tests/Interop/PInvoke/Varargs/VarargsTest.cs | 1 + src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs | 1 + src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs | 1 + 7 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/tests/Interop/COM/ComWrappers/API/Program.cs b/src/tests/Interop/COM/ComWrappers/API/Program.cs index 2751f427838e91..62709f52d03998 100644 --- a/src/tests/Interop/COM/ComWrappers/API/Program.cs +++ b/src/tests/Interop/COM/ComWrappers/API/Program.cs @@ -1125,6 +1125,7 @@ protected override void ReleaseObjects(IEnumerable objects) [Fact] [PlatformSpecific(TestPlatforms.Windows)] // COM apartments are Windows-specific + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public unsafe void CrossApartmentQueryInterface_NoDeadlock() { Console.WriteLine($"Running {nameof(CrossApartmentQueryInterface_NoDeadlock)}..."); diff --git a/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.cs b/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.cs index bf353e472aa9b3..33f27f520d342a 100644 --- a/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.cs +++ b/src/tests/Interop/COM/ExtensionPoints/ExtensionPoints.cs @@ -41,6 +41,7 @@ public virtual void PostHeapMinimize() { } } [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static unsafe void Validate_Managed_IMallocSpy() { Console.WriteLine($"Running {nameof(Validate_Managed_IMallocSpy)}..."); @@ -79,4 +80,4 @@ static int ArrayLen(char** ptr) return (int)(ptr - begin); } } -} \ No newline at end of file +} diff --git a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs index 94d56222a3675e..274176bc503128 100644 --- a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs +++ b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs @@ -356,6 +356,7 @@ public DynamicInterfaceCastable_ValidateBasicInterface() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Assert failure: targetSSP == 0 || (pHandlerIP != NULL) && (exInfo->m_frameIter.m_crawl.GetCodeManager() == ExecutionManager::GetInterpreterCodeManager()) || (*(size_t*)(targetSSP-8) == exInfo->m_frameIter.m_crawl.GetRegisterSet()->ControlPC)", RuntimeTestModes.InterpreterActive)] public static void ValidateBasicInterface() { Console.WriteLine($"Running {nameof(ValidateBasicInterface)}"); @@ -545,6 +546,7 @@ public static void ValidateDirectlyImplemented() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Assert failure: targetSSP == 0 || (pHandlerIP != NULL) && (exInfo->m_frameIter.m_crawl.GetCodeManager() == ExecutionManager::GetInterpreterCodeManager()) || (*(size_t*)(targetSSP-8) == exInfo->m_frameIter.m_crawl.GetRegisterSet()->ControlPC)", RuntimeTestModes.InterpreterActive)] public static void ValidateErrorHandling() { Console.WriteLine($"Running {nameof(ValidateErrorHandling)}"); diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs b/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs index 9bc6d4b05fd6ef..53005fa713abc2 100644 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs +++ b/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs @@ -15,7 +15,7 @@ static int UnmanagedExportedFunction(float arg) { return Convert.ToInt32(arg); } - + [UnmanagedCallersOnly] static BlittableGeneric UnmanagedExportedFunctionBlittableGenericInt(float arg) { @@ -68,6 +68,7 @@ struct BlittableGeneric [InlineData(-1f)] [InlineData(42f)] [InlineData(60f)] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void RunGenericFunctionPointerTest(float inVal) { Console.WriteLine($"Running {nameof(RunGenericFunctionPointerTest)}..."); @@ -80,7 +81,7 @@ public static void RunGenericFunctionPointerTest(float inVal) outVar = GenericCaller.GenericCalli((delegate* unmanaged)&UnmanagedExportedFunction, inVal); } Assert.Equal(expectedValue, outVar); - + outVar = 0; Console.WriteLine("Testing GenericCalli with BlittableGeneric as the return type"); unsafe diff --git a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs index e36cfc158066ba..da6e54e22a1cc8 100644 --- a/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs +++ b/src/tests/Interop/PInvoke/Varargs/VarargsTest.cs @@ -39,6 +39,7 @@ private static bool AssertEqual(string lhs, string rhs) [SkipOnMono("PInvoke Varargs/ArgIterator marshalling not supported on Mono")] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] + [Xunit.SkipOnCoreClrAttribute("Depends on varargs", RuntimeTestModes.InterpreterActive)] public static int TestEntryPoint() { var passed = true; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs index 6e2f062f8412df..5e3eea6e0a4df5 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.BuiltInCom.cs @@ -12,6 +12,7 @@ public partial class Test_VariantTest [Fact] [PlatformSpecific(TestPlatforms.Windows)] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static int TestEntryPoint() { bool builtInComDisabled=false; diff --git a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs index 6300227887921c..156463443a8881 100644 --- a/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs +++ b/src/tests/Interop/PInvoke/Variant/VariantTest.ComWrappers.cs @@ -15,6 +15,7 @@ public partial class Test_VariantTest [Fact] [PlatformSpecific(TestPlatforms.Windows)] [ActiveIssue("https://github.com/dotnet/runtimelab/issues/155", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static int TestEntryPoint() { bool testComMarshal=true; From fe630328816ee2a2813fd78f1b3001b84d9016ec Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 24 Sep 2025 14:53:57 -0700 Subject: [PATCH 05/18] Disable a couple windows-only COM tests that are incompatible with the interpreter --- .../COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs | 1 + .../ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs index eeb20b061e06a7..de8e094101edd9 100644 --- a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs +++ b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.Marshalling.cs @@ -21,6 +21,7 @@ private static void ValidateNotRegisteredForTrackerSupport() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on windows-only COM->CLR transitions flowing hidden parameter", RuntimeTestModes.InterpreterActive)] public static int TestEntryPoint() { try diff --git a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs index 3346bb9237115b..d8b767cd1ebd7d 100644 --- a/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs +++ b/src/tests/Interop/COM/ComWrappers/GlobalInstance/GlobalInstance.TrackerSupport.cs @@ -27,6 +27,7 @@ private static void ValidateNotRegisteredForMarshalling() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on windows-only COM->CLR transitions flowing hidden parameter", RuntimeTestModes.InterpreterActive)] public static int TestEntryPoint() { try From 3486660143764ae0ef00bdcccc6f8d665a89480a Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Thu, 25 Sep 2025 15:39:26 -0700 Subject: [PATCH 06/18] Disable a test that depends on marshaled calli Add an interpreter-fixme comment in a test that's failing --- src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs | 1 + .../Interop/SuppressGCTransition/SuppressGCTransitionTest.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs index 941d4ebce0fe76..41d58b31e0de6e 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs @@ -146,6 +146,7 @@ public static void Out() private static void OutWorker(IntPtr handleValue) { MyCriticalHandle handle; + // Interpreter-FIXME: the `out handle` here does not populate handle with a class instance. Native.Out(handleValue, out handle); Assert.Equal(handleValue.ToInt32(), handle.Handle.ToInt32()); } diff --git a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs index 8a040460f1d89c..9c4131e2120faf 100644 --- a/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs +++ b/src/tests/Interop/SuppressGCTransition/SuppressGCTransitionTest.cs @@ -288,6 +288,7 @@ private static int ILStubCache_NoGCTransition_GCTransition(int expected) [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/91388", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.PlatformDoesNotSupportNativeTestAssets))] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled pinvoke calli", RuntimeTestModes.InterpreterActive)] public static void TestEntryPoint() { CheckGCMode.Initialize(&SuppressGCTransitionNative.SetIsInCooperativeModeFunction); From f0aef5a253ae7b34813b08ed95dcf5f67f423b41 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 29 Sep 2025 12:32:51 -0700 Subject: [PATCH 07/18] Remove unnecessary skip attributes --- src/tests/Interop/IDynamicInterfaceCastable/Program.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs index 274176bc503128..94d56222a3675e 100644 --- a/src/tests/Interop/IDynamicInterfaceCastable/Program.cs +++ b/src/tests/Interop/IDynamicInterfaceCastable/Program.cs @@ -356,7 +356,6 @@ public DynamicInterfaceCastable_ValidateBasicInterface() } [Fact] - [Xunit.SkipOnCoreClrAttribute("Assert failure: targetSSP == 0 || (pHandlerIP != NULL) && (exInfo->m_frameIter.m_crawl.GetCodeManager() == ExecutionManager::GetInterpreterCodeManager()) || (*(size_t*)(targetSSP-8) == exInfo->m_frameIter.m_crawl.GetRegisterSet()->ControlPC)", RuntimeTestModes.InterpreterActive)] public static void ValidateBasicInterface() { Console.WriteLine($"Running {nameof(ValidateBasicInterface)}"); @@ -546,7 +545,6 @@ public static void ValidateDirectlyImplemented() } [Fact] - [Xunit.SkipOnCoreClrAttribute("Assert failure: targetSSP == 0 || (pHandlerIP != NULL) && (exInfo->m_frameIter.m_crawl.GetCodeManager() == ExecutionManager::GetInterpreterCodeManager()) || (*(size_t*)(targetSSP-8) == exInfo->m_frameIter.m_crawl.GetRegisterSet()->ControlPC)", RuntimeTestModes.InterpreterActive)] public static void ValidateErrorHandling() { Console.WriteLine($"Running {nameof(ValidateErrorHandling)}"); From 41ec1b2db48525db8d37a004229da0482599d59e Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 29 Sep 2025 15:57:38 -0700 Subject: [PATCH 08/18] Disable SEH test when interpreting --- src/tests/Common/CoreCLRTestLibrary/Utilities.cs | 12 ++++++++++++ .../NativeLibrary/Callback/CallbackStressTest.cs | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index 302f00c565d0e1..43d54b04541bd3 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -99,6 +99,18 @@ public static bool IsWindowsIoTCore public static bool IsNativeAot => IsNotMonoRuntime && !IsReflectionEmitSupported; public static bool IsNotNativeAot => !IsNativeAot; + public static bool IsClrInterpreterActive + { + get + { + if (!string.IsNullOrWhiteSpace(Environment.GetEnvironmentVariable("DOTNET_Interpreter"))) + return true; + if (int.TryParse(Environment.GetEnvironmentVariable("DOTNET_InterpMode") ?? "", out int mode) && (mode > 0)) + return true; + return false; + } + } + public static bool HasAssemblyFiles => !string.IsNullOrEmpty(typeof(Utilities).Assembly.Location); public static bool IsSingleFile => !HasAssemblyFiles; diff --git a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs index b0cf5c59fb78e9..c896f03ce7abb0 100644 --- a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs +++ b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs @@ -107,7 +107,7 @@ public static void DoCallTryFinally() public static void ManualRaiseException() { #if WINDOWS - if (!TestLibrary.Utilities.IsMonoRuntime) + if (!TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsClrInterpreterActive) { try { From abf4a766db984b15c7e36b1cbde065bc9e041f03 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 29 Sep 2025 16:08:45 -0700 Subject: [PATCH 09/18] Disable some tests for interpreter --- src/tests/Interop/COM/Dynamic/Program.cs | 1 + src/tests/Interop/COM/NETClients/IDispatch/Program.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/Interop/COM/Dynamic/Program.cs b/src/tests/Interop/COM/Dynamic/Program.cs index 9259a067dd083c..6922a9b872be7c 100644 --- a/src/tests/Interop/COM/Dynamic/Program.cs +++ b/src/tests/Interop/COM/Dynamic/Program.cs @@ -11,6 +11,7 @@ namespace Dynamic public class Program { [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on COM behavior that is not correct in interpreter", RuntimeTestModes.InterpreterActive)] public static int TestEntryPoint() { // RegFree COM is not supported on Windows Nano diff --git a/src/tests/Interop/COM/NETClients/IDispatch/Program.cs b/src/tests/Interop/COM/NETClients/IDispatch/Program.cs index 4324913a5a1fb6..d0f5f0ca9fd5d1 100644 --- a/src/tests/Interop/COM/NETClients/IDispatch/Program.cs +++ b/src/tests/Interop/COM/NETClients/IDispatch/Program.cs @@ -350,7 +350,7 @@ static void Validate_ValueCoerce_ReturnToManaged() public static int TestEntryPoint() { // RegFree COM is not supported on Windows Nano - if (Utilities.IsWindowsNanoServer) + if (Utilities.IsWindowsNanoServer || Utilities.IsClrInterpreterActive) { return 100; } From 5bb3b6516d2786750055e87eff610a07043db840 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 29 Sep 2025 16:40:26 -0700 Subject: [PATCH 10/18] Disable EH interop test on interpreter --- .../Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs index 8f8baa7e226f9e..b831514256a618 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs +++ b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs @@ -42,7 +42,7 @@ public static int TestEntryPoint() TestUnmanagedCallersOnlyWithGeneric(); // Exception handling is only supported on CoreCLR Windows. - if (TestLibrary.Utilities.IsWindows && !TestLibrary.Utilities.IsMonoRuntime) + if (TestLibrary.Utilities.IsWindows && !TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsClrInterpreterActive) { TestUnmanagedCallersOnlyValid_ThrowException(); TestUnmanagedCallersOnlyViaUnmanagedCalli_ThrowException(); From 987d65739609a02cb9bb2f2dbfeb02e5560327cb Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 29 Sep 2025 16:45:30 -0700 Subject: [PATCH 11/18] Disable two EH interop scenarios in ExecInDefAppDom --- src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs index e98605c1a0ebf1..cc56d6d6a3cd31 100644 --- a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs +++ b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs @@ -81,10 +81,17 @@ public static int TestEntryPoint() result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "WrongReturnType", "None", COR_E_MISSINGMETHOD, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "Return0", "None", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "Return1", "None", S_OK, 1); - result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ThrowAnything", "None", COR_E_EXCEPTION, 0); + // Interpreter-FIXME: This requires EH interop which is not currently supported by the interpreter + if (!TestLibrary.Utilities.IsClrInterpreterActive) + { + result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ThrowAnything", "None", COR_E_EXCEPTION, 0); + } result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "0", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "200", S_OK, 200); - result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "None", COR_E_FORMAT, 0); + if (!TestLibrary.Utilities.IsClrInterpreterActive) + { + result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "None", COR_E_FORMAT, 0); + } result += TestExecuteInAppDomain(injectedPath, "InjectedCode", "ParseArgument", "300", S_OK, 300); return result; From a1f94ce77a089f11be517816681327820175ef2d Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 29 Sep 2025 17:01:08 -0700 Subject: [PATCH 12/18] Remove outdated comment --- src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs index 41d58b31e0de6e..941d4ebce0fe76 100644 --- a/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs +++ b/src/tests/Interop/PInvoke/CriticalHandles/Test/Test.cs @@ -146,7 +146,6 @@ public static void Out() private static void OutWorker(IntPtr handleValue) { MyCriticalHandle handle; - // Interpreter-FIXME: the `out handle` here does not populate handle with a class instance. Native.Out(handleValue, out handle); Assert.Equal(handleValue.ToInt32(), handle.Handle.ToInt32()); } From e274033a4907245eaf65c97ff59021efa546cce0 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 1 Oct 2025 13:35:08 -0700 Subject: [PATCH 13/18] Disable 2 tests on interpreter --- .../Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs | 1 + src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs b/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs index 53005fa713abc2..6568ee3cc8783f 100644 --- a/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs +++ b/src/tests/Interop/MarshalAPI/FunctionPointer/GenericFunctionPointer.cs @@ -114,6 +114,7 @@ public static void RunGenericFunctionPointerTest(float inVal) } [ConditionalFact(nameof(CanRunInvalidGenericFunctionPointerTest))] + [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void RunInvalidGenericFunctionPointerTest() { Console.WriteLine($"Running {nameof(RunInvalidGenericFunctionPointerTest)}..."); diff --git a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs index 9ed65bd5f2771e..9ca1f50ee5e8ac 100644 --- a/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs +++ b/src/tests/Interop/PInvoke/IEnumerator/IEnumeratorTest.cs @@ -74,6 +74,7 @@ public static void TestManagedRoundTrip() } [Fact] + [Xunit.SkipOnCoreClrAttribute("Depends on COM behavior that is not correct in interpreter", RuntimeTestModes.InterpreterActive)] public static void TestSupportForICustomAdapter() { { From 4ac4bddc0d32480ac25e3f88dd9232e7e9d2e46d Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 1 Oct 2025 13:44:59 -0700 Subject: [PATCH 14/18] Improve diagnostics for int128 test failures --- src/tests/Interop/PInvoke/Int128/Int128Test.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.cs b/src/tests/Interop/PInvoke/Int128/Int128Test.cs index 56bed4f2bfe0ec..faf4541deb65ac 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.cs @@ -10,6 +10,9 @@ public struct StructJustInt128 { public StructJustInt128(Int128 val) { value = val; } public Int128 value; + + public override string ToString () => + $"StructJustInt128(value={value:X32})"; } public struct StructWithInt128 @@ -17,6 +20,9 @@ public struct StructWithInt128 public StructWithInt128(Int128 val) { value = val; messUpPadding = 0x10; } public byte messUpPadding; public Int128 value; + + public override string ToString () => + $"StructWithInt128(messUpPadding={messUpPadding}, value={value:X32})"; } unsafe partial class Int128Native @@ -111,6 +117,7 @@ public static void TestInt128FieldLayout() StructWithInt128 rhs = new StructWithInt128(new Int128(13, 14)); Int128Native.AddStructWithInt128_ByRef(ref lhs, ref rhs); + // Interpreter-FIXME: Incorrect result Assert.Equal(new StructWithInt128(new Int128(24, 26)), lhs); Int128 value2; From 14bb4a29269c97c4421e3c7916ceaab353b9c4f2 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 1 Oct 2025 13:58:59 -0700 Subject: [PATCH 15/18] Fix formatting --- src/tests/Interop/PInvoke/Int128/Int128Test.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.cs b/src/tests/Interop/PInvoke/Int128/Int128Test.cs index faf4541deb65ac..55e6d67fb38426 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.cs @@ -11,8 +11,7 @@ public struct StructJustInt128 public StructJustInt128(Int128 val) { value = val; } public Int128 value; - public override string ToString () => - $"StructJustInt128(value={value:X32})"; + public override string ToString() => $"StructJustInt128(value={value:X32})"; } public struct StructWithInt128 @@ -21,8 +20,7 @@ public struct StructWithInt128 public byte messUpPadding; public Int128 value; - public override string ToString () => - $"StructWithInt128(messUpPadding={messUpPadding}, value={value:X32})"; + public override string ToString() => $"StructWithInt128(messUpPadding={messUpPadding}, value={value:X32})"; } unsafe partial class Int128Native From 1c93ff8b45043bc69329389d05ffbfab22aa8665 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 1 Oct 2025 13:59:49 -0700 Subject: [PATCH 16/18] Fix formatting --- .../CoreCLRTestLibrary/CoreClrConfigurationDetection.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs index fdbf0fe8e2cb14..63d0ceb5bd728e 100644 --- a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs @@ -23,8 +23,10 @@ public static class CoreClrConfigurationDetection public static bool IsTieredCompilation => string.Equals(GetEnvironmentVariableValue("TieredCompilation", "1"), "1", StringComparison.InvariantCulture); public static bool IsHeapVerify => string.Equals(GetEnvironmentVariableValue("HeapVerify"), "1", StringComparison.InvariantCulture); - public static bool IsInterpreterActive { - get { + public static bool IsInterpreterActive + { + get + { if (!string.IsNullOrWhiteSpace(GetEnvironmentVariableValue("Interpreter", ""))) return true; if (int.TryParse(GetEnvironmentVariableValue("InterpMode", "0"), out int mode) && (mode > 0)) From 70ca58a3a7bc657d81953c40545adbe5f5909495 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Wed, 1 Oct 2025 14:18:42 -0700 Subject: [PATCH 17/18] Address PR feedback --- src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs | 2 +- src/tests/Interop/PInvoke/Int128/Int128Test.cs | 2 +- .../Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs index cc56d6d6a3cd31..361dbbc2446570 100644 --- a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs +++ b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs @@ -81,7 +81,7 @@ public static int TestEntryPoint() result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "WrongReturnType", "None", COR_E_MISSINGMETHOD, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "Return0", "None", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "Return1", "None", S_OK, 1); - // Interpreter-FIXME: This requires EH interop which is not currently supported by the interpreter + // This requires EH interop which is not currently supported by the interpreter. See https://github.com/dotnet/runtime/issues/118965 if (!TestLibrary.Utilities.IsClrInterpreterActive) { result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ThrowAnything", "None", COR_E_EXCEPTION, 0); diff --git a/src/tests/Interop/PInvoke/Int128/Int128Test.cs b/src/tests/Interop/PInvoke/Int128/Int128Test.cs index 55e6d67fb38426..22e70843355e16 100644 --- a/src/tests/Interop/PInvoke/Int128/Int128Test.cs +++ b/src/tests/Interop/PInvoke/Int128/Int128Test.cs @@ -115,7 +115,7 @@ public static void TestInt128FieldLayout() StructWithInt128 rhs = new StructWithInt128(new Int128(13, 14)); Int128Native.AddStructWithInt128_ByRef(ref lhs, ref rhs); - // Interpreter-FIXME: Incorrect result + // Interpreter-FIXME: Incorrect result. Tracked by https://github.com/dotnet/runtime/issues/118618 Assert.Equal(new StructWithInt128(new Int128(24, 26)), lhs); Int128 value2; diff --git a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs index b831514256a618..fc52f25934128a 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs +++ b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs @@ -41,7 +41,7 @@ public static int TestEntryPoint() TestPInvokeMarkedWithUnmanagedCallersOnly(); TestUnmanagedCallersOnlyWithGeneric(); - // Exception handling is only supported on CoreCLR Windows. + // Exception handling interop is only supported on CoreCLR Windows. if (TestLibrary.Utilities.IsWindows && !TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsClrInterpreterActive) { TestUnmanagedCallersOnlyValid_ThrowException(); From f0ed28ebf519eb70eae2bf4fe688ac32afd9ca03 Mon Sep 17 00:00:00 2001 From: Katelyn Gadd Date: Mon, 6 Oct 2025 09:20:00 -0700 Subject: [PATCH 18/18] Name updates --- .../CoreCLRTestLibrary/CoreClrConfigurationDetection.cs | 2 +- src/tests/Common/CoreCLRTestLibrary/Utilities.cs | 2 +- .../Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs | 2 +- src/tests/Interop/COM/NETClients/IDispatch/Program.cs | 2 +- src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs | 4 ++-- .../Interop/NativeLibrary/Callback/CallbackStressTest.cs | 2 +- .../Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs index 63d0ceb5bd728e..0f068499a60a08 100644 --- a/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/CoreClrConfigurationDetection.cs @@ -23,7 +23,7 @@ public static class CoreClrConfigurationDetection public static bool IsTieredCompilation => string.Equals(GetEnvironmentVariableValue("TieredCompilation", "1"), "1", StringComparison.InvariantCulture); public static bool IsHeapVerify => string.Equals(GetEnvironmentVariableValue("HeapVerify"), "1", StringComparison.InvariantCulture); - public static bool IsInterpreterActive + public static bool IsCoreClrInterpreter { get { diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index 43d54b04541bd3..35827663d66bd5 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -99,7 +99,7 @@ public static bool IsWindowsIoTCore public static bool IsNativeAot => IsNotMonoRuntime && !IsReflectionEmitSupported; public static bool IsNotNativeAot => !IsNativeAot; - public static bool IsClrInterpreterActive + public static bool IsCoreClrInterpreter { get { diff --git a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs index cf0195d2c6bed1..9ab1ab1ae83dda 100644 --- a/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs +++ b/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.cs @@ -938,7 +938,7 @@ private static ImmutableArray DecorateWithSkipOnCoreClrConfiguration( } if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.InterpreterActive)) { - conditions.Add($"!{ConditionClass}.IsInterpreterActive"); + conditions.Add($"!{ConditionClass}.IsCoreClrInterpreter"); } if (skippedTestModes.HasFlag(Xunit.RuntimeTestModes.AnyGCStress)) diff --git a/src/tests/Interop/COM/NETClients/IDispatch/Program.cs b/src/tests/Interop/COM/NETClients/IDispatch/Program.cs index d0f5f0ca9fd5d1..ecc453883cf68f 100644 --- a/src/tests/Interop/COM/NETClients/IDispatch/Program.cs +++ b/src/tests/Interop/COM/NETClients/IDispatch/Program.cs @@ -350,7 +350,7 @@ static void Validate_ValueCoerce_ReturnToManaged() public static int TestEntryPoint() { // RegFree COM is not supported on Windows Nano - if (Utilities.IsWindowsNanoServer || Utilities.IsClrInterpreterActive) + if (Utilities.IsWindowsNanoServer || Utilities.IsCoreClrInterpreter) { return 100; } diff --git a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs index 361dbbc2446570..698eebc22596a7 100644 --- a/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs +++ b/src/tests/Interop/ExecInDefAppDom/ExecInDefAppDom.cs @@ -82,13 +82,13 @@ public static int TestEntryPoint() result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "Return0", "None", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "Return1", "None", S_OK, 1); // This requires EH interop which is not currently supported by the interpreter. See https://github.com/dotnet/runtime/issues/118965 - if (!TestLibrary.Utilities.IsClrInterpreterActive) + if (!TestLibrary.Utilities.IsCoreClrInterpreter) { result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ThrowAnything", "None", COR_E_EXCEPTION, 0); } result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "0", S_OK, 0); result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "200", S_OK, 200); - if (!TestLibrary.Utilities.IsClrInterpreterActive) + if (!TestLibrary.Utilities.IsCoreClrInterpreter) { result += TestExecuteInAppDomain(myPath, "FakeInjectedCode", "ParseArgument", "None", COR_E_FORMAT, 0); } diff --git a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs index c896f03ce7abb0..650d0ee27d3875 100644 --- a/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs +++ b/src/tests/Interop/NativeLibrary/Callback/CallbackStressTest.cs @@ -107,7 +107,7 @@ public static void DoCallTryFinally() public static void ManualRaiseException() { #if WINDOWS - if (!TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsClrInterpreterActive) + if (!TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsCoreClrInterpreter) { try { diff --git a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs index fc52f25934128a..7d4d3c57d4d85a 100644 --- a/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs +++ b/src/tests/Interop/UnmanagedCallersOnly/UnmanagedCallersOnlyTest.cs @@ -42,7 +42,7 @@ public static int TestEntryPoint() TestUnmanagedCallersOnlyWithGeneric(); // Exception handling interop is only supported on CoreCLR Windows. - if (TestLibrary.Utilities.IsWindows && !TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsClrInterpreterActive) + if (TestLibrary.Utilities.IsWindows && !TestLibrary.Utilities.IsMonoRuntime && !TestLibrary.Utilities.IsCoreClrInterpreter) { TestUnmanagedCallersOnlyValid_ThrowException(); TestUnmanagedCallersOnlyViaUnmanagedCalli_ThrowException();