Skip to content

Commit d40285f

Browse files
committed
JIT: Adjust integral cast round-trip tests
1 parent 13ab4a6 commit d40285f

1 file changed

Lines changed: 5 additions & 14 deletions

File tree

src/tests/JIT/opt/Casts/IntCast.cs

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -53,19 +53,13 @@ static nint Cast_PopCount_To_NInt(ulong value)
5353
}
5454

5555
[MethodImpl(MethodImplOptions.NoInlining)]
56-
static bool TruncatedValueCanBeNegative(long value)
56+
static long Cast_Long_To_Int_To_Long(long value)
5757
{
58-
return unchecked((int)value) < 0;
58+
return unchecked((long)(int)value);
5959
}
6060

6161
[MethodImpl(MethodImplOptions.NoInlining)]
62-
static long TruncatingRoundTripMustRemain(long value)
63-
{
64-
return (long)(int)value;
65-
}
66-
67-
[MethodImpl(MethodImplOptions.NoInlining)]
68-
static long ZeroExtendingRoundTripMustRemain(long value)
62+
static long Cast_Long_To_UInt_To_Long(long value)
6963
{
7064
return unchecked((long)(uint)value);
7165
}
@@ -97,13 +91,10 @@ public static int TestEntryPoint()
9791
if (Cast_PopCount_To_NInt(ulong.MaxValue) != 64)
9892
return 0;
9993

100-
if (!TruncatedValueCanBeNegative(0xFFFF_FFFFL))
101-
return 0;
102-
103-
if (TruncatingRoundTripMustRemain(0xFFFF_FFFFL) != -1)
94+
if (Cast_Long_To_Int_To_Long(0xFFFF_FFFFL) != -1)
10495
return 0;
10596

106-
if (ZeroExtendingRoundTripMustRemain(-1) != uint.MaxValue)
97+
if (Cast_Long_To_UInt_To_Long(-1) != uint.MaxValue)
10798
return 0;
10899

109100
return 100;

0 commit comments

Comments
 (0)