Add a repro test for `IsCompatibleType(cseLclVarTyp, expTyp)` (#38972)
authorSergey Andreenko <seandree@microsoft.com>
Thu, 9 Jul 2020 22:55:31 +0000 (15:55 -0700)
committerGitHub <noreply@github.com>
Thu, 9 Jul 2020 22:55:31 +0000 (15:55 -0700)
* Add a repro test for #35724

* move it to pri1.

src/tests/JIT/Regression/JitBlue/Runtime_35144/Runtime_35144.csproj
src/tests/JIT/Regression/JitBlue/Runtime_35724/Runtime_35724.cs [new file with mode: 0644]
src/tests/JIT/Regression/JitBlue/Runtime_35724/Runtime_35724.csproj [new file with mode: 0644]

index 986494e..656bedd 100644 (file)
@@ -1,6 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Exe</OutputType>
+    <CLRTestPriority>1</CLRTestPriority>
   </PropertyGroup>
   <PropertyGroup>
     <DebugType />
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_35724/Runtime_35724.cs b/src/tests/JIT/Regression/JitBlue/Runtime_35724/Runtime_35724.cs
new file mode 100644 (file)
index 0000000..a465bea
--- /dev/null
@@ -0,0 +1,29 @@
+// 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;
+
+// SIMD8 could be retyped as a long in the past and if that long value was CSE-ed together with original SIMD8
+// values we could hit an assert `IsCompatibleType(cseLclVarTyp, expTyp)`.
+
+class Runtime_35724
+{
+       [MethodImpl(MethodImplOptions.NoInlining)]
+       static Vector2 Test()
+    {
+        Vector2 a = new Vector2(1);
+        Vector2 b = new Vector2(2);
+        Vector2 c = a / b;
+        Vector2 d = a / b;
+        Console.WriteLine(c.X + d.Y);
+        return a / b;
+    }
+       
+    public static int Main()
+    {
+        Test();
+        return 100;
+    }
+}
diff --git a/src/tests/JIT/Regression/JitBlue/Runtime_35724/Runtime_35724.csproj b/src/tests/JIT/Regression/JitBlue/Runtime_35724/Runtime_35724.csproj
new file mode 100644 (file)
index 0000000..986494e
--- /dev/null
@@ -0,0 +1,12 @@
+<Project Sdk="Microsoft.NET.Sdk">
+  <PropertyGroup>
+    <OutputType>Exe</OutputType>
+  </PropertyGroup>
+  <PropertyGroup>
+    <DebugType />
+    <Optimize>True</Optimize>
+  </PropertyGroup>
+  <ItemGroup>
+    <Compile Include="$(MSBuildProjectName).cs" />
+  </ItemGroup>
+</Project>