diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.cs b/src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.cs new file mode 100644 index 0000000000000..e1b82013da915 --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.cs @@ -0,0 +1,31 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Numerics; +using System.Runtime.CompilerServices; + +[module: SkipLocalsInit] + +class Runtime_81585 +{ + static int Main() + { + Vector4 a = new Vector4(new Vector2(1.051f, 2.05f), 3.478f, 1.0f); + Vector4 b = new Vector4(new Vector3(1.051f, 2.05f, 3.478f), 0.0f); + b.W = 1.0f; + + float actual = Vector4.Distance(a, b); + AssertEqual(0.0f, actual); + return 100; + } + + [MethodImpl(MethodImplOptions.NoInlining)] + static void AssertEqual(float expected, float actual) + { + if (expected != actual) + { + throw new Exception($"Expected: {expected}; Actual: {actual}"); + } + } +} diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.csproj new file mode 100644 index 0000000000000..9caa6389f4b8f --- /dev/null +++ b/src/tests/JIT/Regression/JitBlue/Runtime_81585/Runtime_81585.csproj @@ -0,0 +1,13 @@ + + + true + Exe + True + + + + + + + +