From d4c785615fba837c37938feac32569d4a035d04b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Wed, 28 Jan 2026 18:06:00 +0100 Subject: [PATCH] Baseline tests to fix native AOT outerloops These were all enabled in #123112 --- .../Common/CoreCLRTestLibrary/Utilities.cs | 1 + .../StringMarshalling/UTF8/UTF8Test.cs | 27 ++++++++++++------- .../JIT/Methodical/jitinterface/bug603649.cs | 1 + .../CLR-x86-JIT/V2.0-Beta2/b399444/Repro.cs | 2 ++ 4 files changed, 21 insertions(+), 10 deletions(-) diff --git a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs index c26e1473bb7046..f796a7769ed919 100644 --- a/src/tests/Common/CoreCLRTestLibrary/Utilities.cs +++ b/src/tests/Common/CoreCLRTestLibrary/Utilities.cs @@ -92,6 +92,7 @@ public static bool IsWindowsIoTCore // return whether or not the OS is a 64 bit OS public static bool Is64 => (IntPtr.Size == 8); + public static bool Is32 => (IntPtr.Size == 4); public static bool IsMonoRuntime => Type.GetType("Mono.RuntimeStructs") != null; public static bool IsNotMonoRuntime => !IsMonoRuntime; diff --git a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs index 7d0385898b8d51..44decce077a698 100644 --- a/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs +++ b/src/tests/Interop/StringMarshalling/UTF8/UTF8Test.cs @@ -255,14 +255,17 @@ public static void TestEntryPoint() for (int i = 0; i < utf8Strings.Length - 1; i++) UTF8StringTests.TestStringPassByRef(utf8Strings[i], i); + // https://github.com/dotnet/runtime/issues/123529 + if (!TestLibrary.Utilities.IsNativeAot) + { + // Test StringBuilder as [In,Out] parameter + for (int i = 0; i < utf8Strings.Length - 1; i++) + UTF8StringBuilderTests.TestInOutStringBuilderParameter(utf8Strings[i], i); - // Test StringBuilder as [In,Out] parameter - for (int i = 0; i < utf8Strings.Length - 1; i++) - UTF8StringBuilderTests.TestInOutStringBuilderParameter(utf8Strings[i], i); - - // Test StringBuilder as [Out] parameter - for (int i = 0; i < utf8Strings.Length - 1; i++) - UTF8StringBuilderTests.TestOutStringBuilderParameter(utf8Strings[i], i); + // Test StringBuilder as [Out] parameter + for (int i = 0; i < utf8Strings.Length - 1; i++) + UTF8StringBuilderTests.TestOutStringBuilderParameter(utf8Strings[i], i); + } // utf8 string as struct fields UTF8StructMarshalling.TestUTF8StructMarshalling(utf8Strings); @@ -270,9 +273,13 @@ public static void TestEntryPoint() // delegate UTF8DelegateMarshalling.TestUTF8DelegateMarshalling(); - // Test StringBuilder as [Out] parameter - for (int i = 0; i < utf8Strings.Length - 1; i++) - UTF8StringBuilderTests.TestReturnStringBuilder(utf8Strings[i], i); + // https://github.com/dotnet/runtime/issues/123529 + if (!TestLibrary.Utilities.IsNativeAot) + { + // Test StringBuilder as [Out] parameter + for (int i = 0; i < utf8Strings.Length - 1; i++) + UTF8StringBuilderTests.TestReturnStringBuilder(utf8Strings[i], i); + } // String.Empty tests UTF8StringTests.EmptyStringTest(); diff --git a/src/tests/JIT/Methodical/jitinterface/bug603649.cs b/src/tests/JIT/Methodical/jitinterface/bug603649.cs index 46600a1ca703b7..04fb49d2ee02a6 100644 --- a/src/tests/JIT/Methodical/jitinterface/bug603649.cs +++ b/src/tests/JIT/Methodical/jitinterface/bug603649.cs @@ -11,6 +11,7 @@ public class foo private static object s_o = typeof(string); [Fact] [OuterLoop] + [ActiveIssue("https://github.com/dotnet/runtime/issues/122013", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot), nameof(TestLibrary.Utilities.Is32))] public static int TestEntryPoint() { bool f = typeof(string) == s_o as Type; diff --git a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b399444/Repro.cs b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b399444/Repro.cs index dcc99512fe8ba0..78a17b2e043fea 100644 --- a/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b399444/Repro.cs +++ b/src/tests/JIT/Regression/CLR-x86-JIT/V2.0-Beta2/b399444/Repro.cs @@ -12,6 +12,8 @@ public class Test { [OuterLoop] [Fact] + // This needs a CoreCLR TypeLoadException emulator + [ActiveIssue("https://github.com/dotnet/runtime/issues/69919", typeof(TestLibrary.Utilities), nameof(TestLibrary.Utilities.IsNativeAot))] public static int TestEntryPoint() { if ((TestManyFields() == 100)