symmetric_relation = MONO_SYMMETRIC_RELATION (branch_relation);
/* FIXME: Other compare opcodes */
- if (compare->opcode == OP_ICOMPARE) {
+ if (compare->opcode == OP_ICOMPARE && compare->sreg1 != compare->sreg2) {
relations->relation1.variable = compare->sreg1;
relations->relation1.relation.relation = branch_relation;
relations->relation1.relation.related_value.type = MONO_VARIABLE_SUMMARIZED_VALUE;
--- /dev/null
+// 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.Threading.Tasks;
+
+public class Test
+{
+ public int foo;
+
+ public override bool Equals(object o) => false;
+ public override int GetHashCode() => 0;
+
+ public static bool operator ==(Test t1, Test t2) {
+ if (ReferenceEquals(t1, t1))
+ return true;
+ return t1.foo == t2.foo;
+ }
+
+ public static bool operator !=(Test t1, Test t2) {
+ if (ReferenceEquals(t1, t1))
+ return true;
+ return t1.foo == t2.foo;
+ }
+
+ public static int Main () {
+ var t1 = new Test () { foo = 1 };
+ var t2 = new Test () { foo = 2 };
+ if (t1 == t2)
+ return 100;
+ return 100;
+ }
+}
--- /dev/null
+<Project Sdk="Microsoft.NET.Sdk">
+ <PropertyGroup>
+ <OutputType>Exe</OutputType>
+ <CLRTestPriority>0</CLRTestPriority>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="test71592.cs" />
+ </ItemGroup>
+</Project>