diff --git a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs index 090842acf61827..b6d078641d2f7a 100644 --- a/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs +++ b/src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs @@ -71,6 +71,8 @@ public static bool IsNonZeroLowerBoundArraySupported public static bool IsExceptionInteropSupported => IsWindows && !Utilities.IsNativeAot && !Utilities.IsMonoRuntime && !Utilities.IsCoreClrInterpreter; public static bool IsMonoRuntime => Type.GetType("Mono.RuntimeStructs") != null; + public static bool IsCoreCLR => !IsMonoRuntime && Utilities.IsNotNativeAot; + public static bool IsNotCoreCLR => !IsCoreCLR; static string _variant = Environment.GetEnvironmentVariable("DOTNET_RUNTIME_VARIANT"); diff --git a/src/tests/GC/Coverage/271010.cs b/src/tests/GC/Coverage/271010.cs index cb89691f21d4fd..081887f2551460 100644 --- a/src/tests/GC/Coverage/271010.cs +++ b/src/tests/GC/Coverage/271010.cs @@ -12,7 +12,11 @@ public class Test_271010 { - [ActiveIssue("https://github.com/dotnet/runtime/issues/5933", TestRuntimes.CoreCLR)] + public static bool IsCoreClrOnNonBrowser => + TestLibrary.PlatformDetection.IsCoreCLR && + !TestLibrary.PlatformDetection.IsBrowser; + + [ActiveIssue("https://github.com/dotnet/runtime/issues/5933", typeof(Test_271010), nameof(IsCoreClrOnNonBrowser))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/HardwareIntrinsics/General/HwiOp/HwiSideEffects.cs b/src/tests/JIT/HardwareIntrinsics/General/HwiOp/HwiSideEffects.cs index 07552c31e572ac..7c89998df8a380 100644 --- a/src/tests/JIT/HardwareIntrinsics/General/HwiOp/HwiSideEffects.cs +++ b/src/tests/JIT/HardwareIntrinsics/General/HwiOp/HwiSideEffects.cs @@ -35,7 +35,7 @@ private static uint ProblemWithInterferenceChecks(uint a) } [Fact] - [ActiveIssue("https://github.com/dotnet/runtime/issues/114250", TestPlatforms.Browser)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/114250", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBrowser), nameof(TestLibrary.PlatformDetection.IsMonoRuntime))] public static void TestProblemWithThrowingLoads() { Assert.True(ProblemWithThrowingLoads(null)); diff --git a/src/tests/JIT/Methodical/eh/interactions/switchinfinally.cs b/src/tests/JIT/Methodical/eh/interactions/switchinfinally.cs index 8d4878c219a646..acafd243cab9b1 100644 --- a/src/tests/JIT/Methodical/eh/interactions/switchinfinally.cs +++ b/src/tests/JIT/Methodical/eh/interactions/switchinfinally.cs @@ -87,7 +87,8 @@ static Class1() /// The main entry point for the application. /// [Fact] - [ActiveIssue("needs triage", TestPlatforms.Browser | TestPlatforms.Wasi | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("needs triage", TestPlatforms.Wasi | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("needs triage", typeof(TestLibrary.PlatformDetection), nameof(TestLibrary.PlatformDetection.IsBrowser), nameof(TestLibrary.PlatformDetection.IsMonoRuntime))] public static int TestEntryPoint() { //Start recording diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.cs b/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.cs index ec4b9513161f8a..8446bc8f890572 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.cs +++ b/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.cs @@ -6934,8 +6934,8 @@ static unsafe bool MemoryCompare(byte* left, byte* right, int byteCount) return true; } - [ActiveIssue("needs triage", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] - [ActiveIssue("needs triage", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter))] + [ActiveIssue("needs triage", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] + [ActiveIssue("needs triage", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter), nameof(PlatformDetection.IsMonoRuntime))] [Fact] [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile))] public static unsafe int TestEntryPoint() diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.tt b/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.tt index 397c3e64d908c2..79d2e6ce4a5fb8 100644 --- a/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.tt +++ b/src/tests/JIT/Regression/JitBlue/Runtime_64125/Runtime_64125.tt @@ -12,6 +12,8 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using TestLibrary; +using Xunit; namespace Runtime_64125 { @@ -67,7 +69,7 @@ namespace Runtime_64125 #> } - class Program + public class Program { static unsafe void Init(byte* bytes, int byteCount) { @@ -87,7 +89,11 @@ namespace Runtime_64125 return true; } - static unsafe int Main() + [ActiveIssue("needs triage", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] + [ActiveIssue("needs triage", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoInterpreter), nameof(PlatformDetection.IsMonoRuntime))] + [Fact] + [ActiveIssue("https://github.com/dotnet/runtime/issues/91923", typeof(PlatformDetection), nameof(PlatformDetection.IsAppleMobile))] + public static unsafe int TestEntryPoint() { var anyLocation = new AnyLocation(); diff --git a/src/tests/JIT/SIMD/Matrix4x4.cs b/src/tests/JIT/SIMD/Matrix4x4.cs index 898da73100fbd6..6634487539930f 100644 --- a/src/tests/JIT/SIMD/Matrix4x4.cs +++ b/src/tests/JIT/SIMD/Matrix4x4.cs @@ -9,6 +9,12 @@ public class Matrix4x4Test private const int Pass = 100; private const int Fail = -1; + public static bool IsInterpreterExceptCoreClrBrowser => + TestLibrary.Utilities.IsCoreClrInterpreter && + (!OperatingSystem.IsBrowser() || + TestLibrary.Utilities.IsMonoRuntime || + TestLibrary.Utilities.IsNativeAot); + public static int Matrix4x4CreateScaleCenterTest3() { int returnVal = Pass; @@ -31,7 +37,7 @@ public static int Matrix4x4CreateScaleCenterTest3() return returnVal; } - [ActiveIssue("https://github.com/dotnet/runtime/issues/123104", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsCoreClrInterpreter))] + [ActiveIssue("https://github.com/dotnet/runtime/issues/123104", typeof(Matrix4x4Test), nameof(IsInterpreterExceptCoreClrBrowser))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs b/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs index 9003909b6f908a..4ba525db6ff2a2 100644 --- a/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs +++ b/src/tests/JIT/opt/Vectorization/StackallocBlkTests.cs @@ -11,7 +11,7 @@ public unsafe class StackallocTests { - [ActiveIssue("https://github.com/dotnet/runtime/issues/84398", TestPlatforms.Windows, runtimes: TestRuntimes.Mono)] + [ActiveIssue("https://github.com/dotnet/runtime/issues/84398", typeof(PlatformDetection), nameof(PlatformDetection.IsNotCoreCLR))] [Fact] public static int TestEntryPoint() { diff --git a/src/tests/baseservices/invalid_operations/Arrays.cs b/src/tests/baseservices/invalid_operations/Arrays.cs index 37cb37ff7cb6cd..b0e81945073cb6 100644 --- a/src/tests/baseservices/invalid_operations/Arrays.cs +++ b/src/tests/baseservices/invalid_operations/Arrays.cs @@ -12,7 +12,8 @@ public class Arrays { private class TestClass { } - [ActiveIssue("Function mismatch", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] [ActiveIssue("Doesn't compile with LLVM AOT.", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAnyAOT))] [Fact] public static void TypeMismatch_ArrayElement() @@ -24,8 +25,9 @@ public static void TypeMismatch_ArrayElement() Assert.IsType(e.InnerException); } + [ActiveIssue("Function mismatch", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] [ActiveIssue("Doesn't compile with LLVM AOT.", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAnyAOT))] - [ActiveIssue("Function mismatch", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] public static void TypeMismatch_MultidimensionalArrayElement() { @@ -36,8 +38,9 @@ public static void TypeMismatch_MultidimensionalArrayElement() Assert.IsType(e.InnerException); } + [ActiveIssue("Function mismatch", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] [ActiveIssue("Doesn't compile with LLVM AOT.", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAnyAOT))] - [ActiveIssue("Function mismatch", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] public static void TypeMismatch_ClassElement() { diff --git a/src/tests/baseservices/invalid_operations/ManagedPointers.cs b/src/tests/baseservices/invalid_operations/ManagedPointers.cs index 44f99b77d180b6..c6c20f344793f0 100644 --- a/src/tests/baseservices/invalid_operations/ManagedPointers.cs +++ b/src/tests/baseservices/invalid_operations/ManagedPointers.cs @@ -11,8 +11,9 @@ public unsafe class ManagedPointers { + [ActiveIssue("Function mismatch", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] [ActiveIssue("Doesn't compile with LLVM AOT.", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAnyAOT))] - [ActiveIssue("Function mismatch", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] public static void Validate_BoxingHelpers_NullByRef() { @@ -31,8 +32,9 @@ public static void Validate_BoxingHelpers_NullByRef() }); } + [ActiveIssue("Function mismatch", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] [ActiveIssue("Doesn't compile with LLVM AOT.", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAnyAOT))] - [ActiveIssue("Function mismatch", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] [Xunit.SkipOnCoreClrAttribute("Depends on marshalled calli", RuntimeTestModes.InterpreterActive)] public static void Validate_GeneratedILStubs_NullByRef() @@ -58,8 +60,9 @@ public static void Validate_GeneratedILStubs_NullByRef() static nint PassByRef(void* a) => (nint)a; } + [ActiveIssue("Function mismatch", TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] + [ActiveIssue("Function mismatch", typeof(PlatformDetection), nameof(PlatformDetection.IsBrowser), nameof(PlatformDetection.IsMonoRuntime))] [ActiveIssue("Doesn't compile with LLVM AOT.", typeof(PlatformDetection), nameof(PlatformDetection.IsMonoAnyAOT))] - [ActiveIssue("Function mismatch", TestPlatforms.Browser | TestPlatforms.iOS | TestPlatforms.tvOS | TestPlatforms.MacCatalyst)] [Fact] public static void Validate_IntrinsicMethodsWithByRef_NullByRef() {