diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_37506/Runtime_36584.cs b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_37506/Runtime_36584.cs new file mode 100644 index 00000000000000..2b014e66997ebd --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_37506/Runtime_36584.cs @@ -0,0 +1,24 @@ +// Licensed to the .NET Foundation under one or more agreements. +// 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.Numerics; +using System.Diagnostics; + +class Runtime_37506 +{ + public static int Main() + { + var a = new Vector(new Vector4(1)); + try + { + a = a + a; + Debug.Assert(false, "unreachable"); + } + catch (System.NotSupportedException) + { + } + return 100; + + } +} diff --git a/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_37506/Runtime_36584.csproj b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_37506/Runtime_36584.csproj new file mode 100644 index 00000000000000..5d49e8d49736fa --- /dev/null +++ b/src/coreclr/tests/src/JIT/Regression/JitBlue/Runtime_37506/Runtime_36584.csproj @@ -0,0 +1,13 @@ + + + Exe + + + + True + True + + + + + diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index 4cfebe72cab69d..e94020f75e0cbb 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -823,6 +823,10 @@ public readonly bool TryCopyTo(Span destination) sum.register.double_0 = (double)(left.register.double_0 + right.register.double_0); sum.register.double_1 = (double)(left.register.double_1 + right.register.double_1); } + else + { + throw new NotSupportedException(SR.Arg_TypeNotSupported); + } return sum; } } @@ -1035,6 +1039,10 @@ public readonly bool TryCopyTo(Span destination) difference.register.double_0 = (double)(left.register.double_0 - right.register.double_0); difference.register.double_1 = (double)(left.register.double_1 - right.register.double_1); } + else + { + throw new NotSupportedException(SR.Arg_TypeNotSupported); + } return difference; } } @@ -1248,6 +1256,10 @@ public readonly bool TryCopyTo(Span destination) product.register.double_0 = (double)(left.register.double_0 * right.register.double_0); product.register.double_1 = (double)(left.register.double_1 * right.register.double_1); } + else + { + throw new NotSupportedException(SR.Arg_TypeNotSupported); + } return product; } } @@ -1481,6 +1493,10 @@ public readonly bool TryCopyTo(Span destination) quotient.register.double_0 = (double)(left.register.double_0 / right.register.double_0); quotient.register.double_1 = (double)(left.register.double_1 / right.register.double_1); } + else + { + throw new NotSupportedException(SR.Arg_TypeNotSupported); + } return quotient; } }