From dcaf4e14415b124dd660b3d22ba0cdfac1c73cd8 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Mon, 10 Dec 2018 20:58:09 +0100 Subject: [PATCH] Fix test in opt and roslyn config. --- .../TestCases/Pretty/ConstantsTests.cs | 3 +- .../TestCases/Pretty/ConstantsTests.il | 41 +++++++++---------- .../TestCases/Pretty/ConstantsTests.opt.il | 29 +++++++------ .../Pretty/ConstantsTests.opt.roslyn.il | 25 ++++++----- .../TestCases/Pretty/ConstantsTests.roslyn.il | 36 ++++++++-------- 5 files changed, 66 insertions(+), 68 deletions(-) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.cs index 4b01009bf..83a151048 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.cs @@ -4,7 +4,8 @@ { public ulong Issue1308(ulong u = 8uL) { - return ((u & uint.MaxValue) != 0) ? 18446744069414584320uL : 0; + Test((u & uint.MaxValue) != 0); + return 18446744069414584320uL; } public void Byte_BitmaskingInCondition(byte v) diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.il index 63491dfae..ef941f9e7 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.il @@ -36,29 +36,28 @@ Issue1308([opt] uint64 u) cil managed { .param [1] = uint64(0x8) - // Code size 28 (0x1c) - .maxstack 2 + // Code size 33 (0x21) + .maxstack 3 .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 + IL_0001: ldarg.0 + IL_0002: ldarg.1 + IL_0003: ldc.i4.m1 + IL_0004: conv.u8 + IL_0005: and + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: ceq + IL_000a: ldc.i4.0 + IL_000b: ceq + IL_000d: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests::Test(bool) + IL_0012: nop + IL_0013: ldc.i8 0xffffffff00000000 + IL_001c: stloc.0 + IL_001d: br.s IL_001f + + IL_001f: ldloc.0 + IL_0020: ret } // end of method ConstantsTests::Issue1308 .method public hidebysig instance void diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.il index 838e85a1d..8ada5c036 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.il @@ -36,22 +36,21 @@ Issue1308([opt] uint64 u) cil managed { .param [1] = uint64(0x8) - // Code size 21 (0x15) + // Code size 27 (0x1b) .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 + IL_0000: ldarg.0 + 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: ceq + IL_0009: ldc.i4.0 + IL_000a: ceq + IL_000c: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests::Test(bool) + IL_0011: ldc.i8 0xffffffff00000000 + IL_001a: ret } // end of method ConstantsTests::Issue1308 .method public hidebysig instance void diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.roslyn.il index c145ef485..db8a15f20 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.roslyn.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.opt.roslyn.il @@ -40,20 +40,19 @@ Issue1308([opt] uint64 u) cil managed { .param [1] = uint64(0x8) - // Code size 19 (0x13) + // Code size 24 (0x18) .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 + IL_0000: ldarg.0 + 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: cgt.un + IL_0009: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests::Test(bool) + IL_000e: ldc.i8 0xffffffff00000000 + IL_0017: ret } // end of method ConstantsTests::Issue1308 .method public hidebysig instance void diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.roslyn.il index 19e7d212f..c81eac37c 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.roslyn.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/ConstantsTests.roslyn.il @@ -40,26 +40,26 @@ Issue1308([opt] uint64 u) cil managed { .param [1] = uint64(0x8) - // Code size 25 (0x19) - .maxstack 2 + // Code size 30 (0x1e) + .maxstack 3 .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 + IL_0001: ldarg.0 + IL_0002: ldarg.1 + IL_0003: ldc.i4.m1 + IL_0004: conv.u8 + IL_0005: and + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: cgt.un + IL_000a: call instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.ConstantsTests::Test(bool) + IL_000f: nop + IL_0010: ldc.i8 0xffffffff00000000 + IL_0019: stloc.0 + IL_001a: br.s IL_001c + + IL_001c: ldloc.0 + IL_001d: ret } // end of method ConstantsTests::Issue1308 .method public hidebysig instance void