Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Result for EnumCompareTo differs from Core implementation #14551

Closed
steveisok opened this issue May 21, 2019 · 0 comments · Fixed by #14553

Comments

@steveisok
Copy link
Contributor

@steveisok steveisok commented May 21, 2019

Steps to Reproduce

Set mono up w/ netcore=only and enable System.Collections.Generic.Tests.ComparerTests.MostComparisons.

Current Behavior

Given this code:

var comparer = Comparer<UInt64Enum>.Default;
var left = (UInt64Enum)ulong.MaxValue;
var right = (UInt64Enum)((ulong)long.MaxValue); 

var ret = comparer.Compare(left, right);
Console.WriteLine("Compare return value: " + ret.ToString());

public enum UInt64Enum : ulong
{
   Min = ulong.MinValue,
   One = 1,
   Two = 2,
   Max = ulong.MaxValue,
}

Mono will return -1 from Compare and Core will return 1.

It appears to be a difference w/ intrinsics at emit_jit_helpers_intrinsics in intrinsics.c

Expected Behavior

Mono and Core results should be the same.

On which platforms did you notice this

[X] macOS
[ ] Linux
[ ] Windows

vargaz added a commit to vargaz/mono that referenced this issue May 21, 2019
vargaz added a commit to vargaz/mono that referenced this issue May 21, 2019
vargaz added a commit to vargaz/mono that referenced this issue May 21, 2019
vargaz added a commit that referenced this issue May 22, 2019
…intrinsic. (#14553)

Fixes #14551.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.