Browse Source

Add a test case for #1308.

pull/1322/head
Siegfried Pammer 7 years ago
parent
commit
e917f57803
  1. 5
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.cs
  2. 29
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.il
  3. 22
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.il
  4. 20
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.roslyn.il
  5. 26
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.roslyn.il

5
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.cs

@ -2,6 +2,11 @@ @@ -2,6 +2,11 @@
{
internal class ConstantsTests
{
public ulong Issue1308(ulong u = 8uL)
{
return ((u & uint.MaxValue) != 0) ? 18446744069414584320uL : 0;
}
public void Byte_BitmaskingInCondition(byte v)
{
Test((v & 0xF) == 0);

29
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.il

@ -32,6 +32,35 @@ @@ -32,6 +32,35 @@
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests
extends [mscorlib]System.Object
{
.method public hidebysig instance uint64
Issue1308([opt] uint64 u) cil managed
{
.param [1] = uint64(0x8)
// Code size 28 (0x1c)
.maxstack 2
.locals init (uint64 V_0)
IL_0000: nop
IL_0001: ldarg.1
IL_0002: ldc.i4.m1
IL_0003: conv.u8
IL_0004: and
IL_0005: ldc.i4.0
IL_0006: conv.i8
IL_0007: bne.un.s IL_000d
IL_0009: ldc.i4.0
IL_000a: conv.i8
IL_000b: br.s IL_0016
IL_000d: ldc.i8 0xffffffff00000000
IL_0016: nop
IL_0017: stloc.0
IL_0018: br.s IL_001a
IL_001a: ldloc.0
IL_001b: ret
} // end of method ConstantsTests::Issue1308
.method public hidebysig instance void
Byte_BitmaskingInCondition(uint8 v) cil managed
{

22
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.il

@ -32,6 +32,28 @@ @@ -32,6 +32,28 @@
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests
extends [mscorlib]System.Object
{
.method public hidebysig instance uint64
Issue1308([opt] uint64 u) cil managed
{
.param [1] = uint64(0x8)
// Code size 21 (0x15)
.maxstack 8
IL_0000: ldarg.1
IL_0001: ldc.i4.m1
IL_0002: conv.u8
IL_0003: and
IL_0004: ldc.i4.0
IL_0005: conv.i8
IL_0006: bne.un.s IL_000b
IL_0008: ldc.i4.0
IL_0009: conv.i8
IL_000a: ret
IL_000b: ldc.i8 0xffffffff00000000
IL_0014: ret
} // end of method ConstantsTests::Issue1308
.method public hidebysig instance void
Byte_BitmaskingInCondition(uint8 v) cil managed
{

20
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.roslyn.il

@ -36,6 +36,26 @@ @@ -36,6 +36,26 @@
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests
extends [mscorlib]System.Object
{
.method public hidebysig instance uint64
Issue1308([opt] uint64 u) cil managed
{
.param [1] = uint64(0x8)
// Code size 19 (0x13)
.maxstack 8
IL_0000: ldarg.1
IL_0001: ldc.i4.m1
IL_0002: conv.u8
IL_0003: and
IL_0004: brtrue.s IL_0009
IL_0006: ldc.i4.0
IL_0007: conv.i8
IL_0008: ret
IL_0009: ldc.i8 0xffffffff00000000
IL_0012: ret
} // end of method ConstantsTests::Issue1308
.method public hidebysig instance void
Byte_BitmaskingInCondition(uint8 v) cil managed
{

26
ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.roslyn.il

@ -36,6 +36,32 @@ @@ -36,6 +36,32 @@
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests
extends [mscorlib]System.Object
{
.method public hidebysig instance uint64
Issue1308([opt] uint64 u) cil managed
{
.param [1] = uint64(0x8)
// Code size 25 (0x19)
.maxstack 2
.locals init (uint64 V_0)
IL_0000: nop
IL_0001: ldarg.1
IL_0002: ldc.i4.m1
IL_0003: conv.u8
IL_0004: and
IL_0005: brtrue.s IL_000b
IL_0007: ldc.i4.0
IL_0008: conv.i8
IL_0009: br.s IL_0014
IL_000b: ldc.i8 0xffffffff00000000
IL_0014: stloc.0
IL_0015: br.s IL_0017
IL_0017: ldloc.0
IL_0018: ret
} // end of method ConstantsTests::Issue1308
.method public hidebysig instance void
Byte_BitmaskingInCondition(uint8 v) cil managed
{

Loading…
Cancel
Save