diff --git a/src/coreclr/vm/typedesc.cpp b/src/coreclr/vm/typedesc.cpp index 657170b3bbcc9c..670b41d6e7dab4 100644 --- a/src/coreclr/vm/typedesc.cpp +++ b/src/coreclr/vm/typedesc.cpp @@ -1730,6 +1730,11 @@ BOOL TypeVarTypeDesc::SatisfiesConstraints(SigTypeContext *pTypeContextOfConstra } CONTRACTL_END; + // During EEStartup, we cannot safely validate constraints, but we can also be confident that the code doesn't violate them + // Just skip validation and declare that the constraints are satisfied. + if (g_fEEInit) + return TRUE; + IMDInternalImport* pInternalImport = GetModule()->GetMDImport(); mdGenericParamConstraint tkConstraint; diff --git a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems index 9f40bcdc3655ff..1ea21363777439 100644 --- a/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems +++ b/src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems @@ -17,6 +17,7 @@ $(MSBuildThisFileDirectory)ILLink\ true true + false $(DefineConstants);TARGET_32BIT diff --git a/src/tests/JIT/Math/Generic/GenericMathTests.cs b/src/tests/JIT/Math/Generic/GenericMathTests.cs index 77c7d174c365a3..2f3da1b168d146 100644 --- a/src/tests/JIT/Math/Generic/GenericMathTests.cs +++ b/src/tests/JIT/Math/Generic/GenericMathTests.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Collections.Generic; + namespace System.GenericMath { public abstract class GenericMathTests diff --git a/src/tests/JIT/Math/Generic/Int32Tests.cs b/src/tests/JIT/Math/Generic/Int32Tests.cs index bbca280de5f53e..5916bcaaa5e454 100644 --- a/src/tests/JIT/Math/Generic/Int32Tests.cs +++ b/src/tests/JIT/Math/Generic/Int32Tests.cs @@ -2,6 +2,8 @@ // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using System.Linq; + namespace System.GenericMath { public sealed class Int32Tests : GenericMathTests @@ -15,7 +17,7 @@ public override void SumTest() if (expected != actual) { - throw new InvalidOperationException($"Expected: {expected}; Actual: {Actual}"); + throw new InvalidOperationException($"Expected: {expected}; Actual: {actual}"); } } } diff --git a/src/tests/JIT/Math/Generic/Program.cs b/src/tests/JIT/Math/Generic/Program.cs index b39408d67c587d..fbd63b8795dcac 100644 --- a/src/tests/JIT/Math/Generic/Program.cs +++ b/src/tests/JIT/Math/Generic/Program.cs @@ -22,8 +22,9 @@ private static int Test(Action action) { action(); } - catch + catch (Exception e) { + Console.WriteLine(e); return -1; }