From cf77457afae6256ace8044281fd7bec4dd1e5f08 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 17 Feb 2019 17:57:52 +0100 Subject: [PATCH] Merge IncrementDecrement.cs into CompoundAssignmentTest --- .../IncrementDecrement.cs | 254 --------- .../Pretty/CompoundAssignmentTest.cs | 128 +++++ .../Pretty/CompoundAssignmentTest.il | 517 ++++++++++++++++++ .../Pretty/CompoundAssignmentTest.opt.il | 398 ++++++++++++++ .../CompoundAssignmentTest.opt.roslyn.il | 398 ++++++++++++++ .../Pretty/CompoundAssignmentTest.roslyn.il | 517 ++++++++++++++++++ 6 files changed, 1958 insertions(+), 254 deletions(-) delete mode 100644 ICSharpCode.Decompiler.Tests/IncrementDecrement.cs diff --git a/ICSharpCode.Decompiler.Tests/IncrementDecrement.cs b/ICSharpCode.Decompiler.Tests/IncrementDecrement.cs deleted file mode 100644 index e06b680d6..000000000 --- a/ICSharpCode.Decompiler.Tests/IncrementDecrement.cs +++ /dev/null @@ -1,254 +0,0 @@ -// Copyright (c) AlphaSierraPapa for the SharpDevelop Team -// -// Permission is hereby granted, free of charge, to any person obtaining a copy of this -// software and associated documentation files (the "Software"), to deal in the Software -// without restriction, including without limitation the rights to use, copy, modify, merge, -// publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons -// to whom the Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in all copies or -// substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, -// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR -// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE -// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -// DEALINGS IN THE SOFTWARE. - -using System; - -public class IncrementDecrement -{ - [Flags] - private enum MyEnum - { - None = 0, - One = 1, - Two = 2, - Four = 4 - } - - public class MutableClass - { - public int Field; - - public int Property - { - get; - set; - } - - public uint this[string name] - { - get - { - return 0u; - } - set - { - } - } - } - - private IncrementDecrement.MyEnum enumField; - public static int StaticField; - - public static int StaticProperty - { - get; - set; - } - - private IncrementDecrement.MutableClass M() - { - return new IncrementDecrement.MutableClass(); - } - - private int[,] Array() - { - return null; - } - - private unsafe int* GetPointer() - { - return null; - } - - public int PreIncrementInAddition(int i, int j) - { - return i + ++j; - } - - public int PreIncrementArrayElement(int[] array, int pos) - { - return --array[pos]; - } - - public int PreIncrementInstanceField() - { - return ++this.M().Field; - } - - public int PreIncrementInstanceField2(IncrementDecrement.MutableClass m) - { - return ++m.Field; - } - - public int PreIncrementInstanceProperty() - { - return ++this.M().Property; - } - - public int PreIncrementStaticField() - { - return ++IncrementDecrement.StaticField; - } - - public int PreIncrementStaticProperty() - { - return ++IncrementDecrement.StaticProperty; - } - -// public uint PreIncrementIndexer(string name) -// { -// return ++this.M()[name]; -// } - - public int PreIncrementByRef(ref int i) - { - return ++i; - } - - public unsafe int PreIncrementByPointer() - { - return ++(*this.GetPointer()); - } - - public int PreIncrement2DArray() - { - return ++this.Array()[1, 2]; - } - - public int CompoundAssignInstanceField() - { - return this.M().Field *= 10; - } - - public int CompoundAssignInstanceProperty() - { - return this.M().Property *= 10; - } - - public int CompoundAssignStaticField() - { - return IncrementDecrement.StaticField ^= 100; - } - - public int CompoundAssignStaticProperty() - { - return IncrementDecrement.StaticProperty &= 10; - } - - public int CompoundAssignArrayElement1(int[] array, int pos) - { - return array[pos] *= 10; - } - - public int CompoundAssignArrayElement2(int[] array) - { - return array[Environment.TickCount] *= 10; - } - -// public uint CompoundAssignIndexer(string name) -// { -// return this.M()[name] -= 2; -// } - - public int CompoundAssignIncrement2DArray() - { - return this.Array()[1, 2] %= 10; - } - - public int CompoundAssignByRef(ref int i) - { - return i <<= 2; - } - - public unsafe double CompoundAssignByPointer(double* ptr) - { - return *ptr /= 1.5; - } - - public void CompoundAssignEnum() - { - this.enumField |= IncrementDecrement.MyEnum.Two; - this.enumField &= ~IncrementDecrement.MyEnum.Four; - } - - public int PostIncrementInAddition(int i, int j) - { - return i++ + j; - } - - public void PostIncrementInlineLocalVariable(Func f) - { - int num = 0; - f(num++); - } - - public int PostIncrementArrayElement(int[] array, int pos) - { - return array[pos]--; - } - - public int PostIncrementStaticField() - { - return IncrementDecrement.StaticField++; - } - - public int PostIncrementStaticProperty() - { - return IncrementDecrement.StaticProperty++; - } - - public int PostIncrementInstanceField(IncrementDecrement.MutableClass m) - { - return m.Field++; - } - -// public uint PostIncrementIndexer(string name) -// { -// return this.M()[name]++; -// } - -// public unsafe int PostIncrementOfPointer(int* ptr) -// { -// return *(ptr++); -// } - - public int PostIncrementInstanceField() - { - return this.M().Field--; - } - - public int PostIncrementInstanceProperty() - { - return this.M().Property--; - } - - public int PostIncrement2DArray() - { - return this.Array()[IncrementDecrement.StaticField, IncrementDecrement.StaticProperty]++; - } - - public int PostIncrementByRef(ref int i) - { - return i++; - } - - public unsafe int PostIncrementByPointer() - { - return (*this.GetPointer())++; - } -} diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs index 47218c53a..5244e21c0 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.cs @@ -4576,5 +4576,133 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty new CustomClass().StringProp += "a"; new CustomClass().StringProp += 1; } + +#if false + public uint PreIncrementIndexer(string name) + { + return ++M()[name]; + } +#endif + public int PreIncrementByRef(ref int i) + { + return ++i; + } + + public unsafe int PreIncrementByPointer() + { + return ++(*GetPointer()); + } + + public int PreIncrement2DArray() + { + return ++Array()[1, 2]; + } + + public int CompoundAssignInstanceField() + { + return M().Field *= 10; + } + + public int CompoundAssignInstanceProperty() + { + return M().Property *= 10; + } + + public int CompoundAssignStaticField() + { + return StaticField ^= 100; + } + + public int CompoundAssignStaticProperty() + { + return StaticProperty &= 10; + } + + public int CompoundAssignArrayElement1(int[] array, int pos) + { + return array[pos] *= 10; + } + + public int CompoundAssignArrayElement2(int[] array) + { + return array[Environment.TickCount] *= 10; + } +#if false + public uint CompoundAssignIndexer(string name) + { + return M()[name] -= 2; + } +#endif + public int CompoundAssignIncrement2DArray() + { + return Array()[1, 2] %= 10; + } + + public int CompoundAssignByRef(ref int i) + { + return i <<= 2; + } + + public unsafe double CompoundAssignByPointer(double* ptr) + { + return *ptr /= 1.5; + } + + public void CompoundAssignEnum() + { + enumField |= MyEnum.Two; + enumField &= ~MyEnum.Four; + } + + public int PostIncrementInAddition(int i, int j) + { + return i++ + j; + } + + public void PostIncrementInlineLocalVariable(Func f) + { + int num = 0; + f(num++); + } + + public int PostDecrementArrayElement(int[] array, int pos) + { + return array[pos]--; + } +#if false + public uint PostIncrementIndexer(string name) + { + return M()[name]++; + } + + public unsafe int PostIncrementOfPointer(int* ptr) + { + return *(ptr++); + } +#endif + public int PostDecrementInstanceField() + { + return M().Field--; + } + + public int PostDecrementInstanceProperty() + { + return M().Property--; + } + + public int PostIncrement2DArray() + { + return Array()[StaticField, StaticProperty]++; + } + + public int PostIncrementByRef(ref int i) + { + return i++; + } + + public unsafe int PostIncrementByPointer() + { + return (*GetPointer())++; + } } } diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.il index b12e34302..70b8a268c 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.il @@ -21596,6 +21596,523 @@ IL_0063: ret } // end of method CompoundAssignmentTest::StringPropertyCompoundAssign + .method public hidebysig instance int32 + PreIncrementByRef(int32& i) cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldind.i4 + IL_0004: ldc.i4.1 + IL_0005: add + IL_0006: dup + IL_0007: stloc.1 + IL_0008: stind.i4 + IL_0009: ldloc.1 + IL_000a: stloc.0 + IL_000b: br.s IL_000d + + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::PreIncrementByRef + + .method public hidebysig instance int32 + PreIncrementByPointer() cil managed + { + // Code size 20 (0x14) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0007: dup + IL_0008: ldind.i4 + IL_0009: ldc.i4.1 + IL_000a: add + IL_000b: dup + IL_000c: stloc.1 + IL_000d: stind.i4 + IL_000e: ldloc.1 + IL_000f: stloc.0 + IL_0010: br.s IL_0012 + + IL_0012: ldloc.0 + IL_0013: ret + } // end of method CompoundAssignmentTest::PreIncrementByPointer + + .method public hidebysig instance int32 + PreIncrement2DArray() cil managed + { + // Code size 35 (0x23) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0007: ldc.i4.1 + IL_0008: ldc.i4.2 + IL_0009: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000e: dup + IL_000f: ldobj [mscorlib]System.Int32 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: dup + IL_0017: stloc.1 + IL_0018: stobj [mscorlib]System.Int32 + IL_001d: ldloc.1 + IL_001e: stloc.0 + IL_001f: br.s IL_0021 + + IL_0021: ldloc.0 + IL_0022: ret + } // end of method CompoundAssignmentTest::PreIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignInstanceField() cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000d: ldc.i4.s 10 + IL_000f: mul + IL_0010: dup + IL_0011: stloc.1 + IL_0012: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0017: ldloc.1 + IL_0018: stloc.0 + IL_0019: br.s IL_001b + + IL_001b: ldloc.0 + IL_001c: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceField + + .method public hidebysig instance int32 + CompoundAssignInstanceProperty() cil managed + { + // Code size 30 (0x1e) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000d: ldc.i4.s 10 + IL_000f: mul + IL_0010: dup + IL_0011: stloc.1 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0017: nop + IL_0018: ldloc.1 + IL_0019: stloc.0 + IL_001a: br.s IL_001c + + IL_001c: ldloc.0 + IL_001d: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceProperty + + .method public hidebysig instance int32 + CompoundAssignStaticField() cil managed + { + // Code size 20 (0x14) + .maxstack 2 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_0006: ldc.i4.s 100 + IL_0008: xor + IL_0009: dup + IL_000a: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000f: stloc.0 + IL_0010: br.s IL_0012 + + IL_0012: ldloc.0 + IL_0013: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticField + + .method public hidebysig instance int32 + CompoundAssignStaticProperty() cil managed + { + // Code size 21 (0x15) + .maxstack 2 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0006: ldc.i4.s 10 + IL_0008: and + IL_0009: dup + IL_000a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticProperty(int32) + IL_000f: nop + IL_0010: stloc.0 + IL_0011: br.s IL_0013 + + IL_0013: ldloc.0 + IL_0014: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticProperty + + .method public hidebysig instance int32 + CompoundAssignArrayElement1(int32[] 'array', + int32 pos) cil managed + { + // Code size 30 (0x1e) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: ldelema [mscorlib]System.Int32 + IL_0008: dup + IL_0009: ldobj [mscorlib]System.Int32 + IL_000e: ldc.i4.s 10 + IL_0010: mul + IL_0011: dup + IL_0012: stloc.1 + IL_0013: stobj [mscorlib]System.Int32 + IL_0018: ldloc.1 + IL_0019: stloc.0 + IL_001a: br.s IL_001c + + IL_001c: ldloc.0 + IL_001d: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement1 + + .method public hidebysig instance int32 + CompoundAssignArrayElement2(int32[] 'array') cil managed + { + // Code size 34 (0x22) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: call int32 [mscorlib]System.Environment::get_TickCount() + IL_0007: ldelema [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldobj [mscorlib]System.Int32 + IL_0012: ldc.i4.s 10 + IL_0014: mul + IL_0015: dup + IL_0016: stloc.1 + IL_0017: stobj [mscorlib]System.Int32 + IL_001c: ldloc.1 + IL_001d: stloc.0 + IL_001e: br.s IL_0020 + + IL_0020: ldloc.0 + IL_0021: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement2 + + .method public hidebysig instance int32 + CompoundAssignIncrement2DArray() cil managed + { + // Code size 36 (0x24) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0007: ldc.i4.1 + IL_0008: ldc.i4.2 + IL_0009: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000e: dup + IL_000f: ldobj [mscorlib]System.Int32 + IL_0014: ldc.i4.s 10 + IL_0016: rem + IL_0017: dup + IL_0018: stloc.1 + IL_0019: stobj [mscorlib]System.Int32 + IL_001e: ldloc.1 + IL_001f: stloc.0 + IL_0020: br.s IL_0022 + + IL_0022: ldloc.0 + IL_0023: ret + } // end of method CompoundAssignmentTest::CompoundAssignIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignByRef(int32& i) cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldind.i4 + IL_0004: ldc.i4.2 + IL_0005: shl + IL_0006: dup + IL_0007: stloc.1 + IL_0008: stind.i4 + IL_0009: ldloc.1 + IL_000a: stloc.0 + IL_000b: br.s IL_000d + + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::CompoundAssignByRef + + .method public hidebysig instance float64 + CompoundAssignByPointer(float64* ptr) cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (float64 V_0, + float64 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldind.r8 + IL_0004: ldc.r8 1.5 + IL_000d: div + IL_000e: dup + IL_000f: stloc.1 + IL_0010: stind.r8 + IL_0011: ldloc.1 + IL_0012: stloc.0 + IL_0013: br.s IL_0015 + + IL_0015: ldloc.0 + IL_0016: ret + } // end of method CompoundAssignmentTest::CompoundAssignByPointer + + .method public hidebysig instance void + CompoundAssignEnum() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: dup + IL_0003: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0008: ldc.i4.2 + IL_0009: or + IL_000a: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_000f: ldarg.0 + IL_0010: dup + IL_0011: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0016: ldc.i4.s -5 + IL_0018: and + IL_0019: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_001e: ret + } // end of method CompoundAssignmentTest::CompoundAssignEnum + + .method public hidebysig instance int32 + PostIncrementInAddition(int32 i, + int32 j) cil managed + { + // Code size 14 (0xe) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldc.i4.1 + IL_0004: add + IL_0005: starg.s i + IL_0007: ldarg.2 + IL_0008: add + IL_0009: stloc.0 + IL_000a: br.s IL_000c + + IL_000c: ldloc.0 + IL_000d: ret + } // end of method CompoundAssignmentTest::PostIncrementInAddition + + .method public hidebysig instance void + PostIncrementInlineLocalVariable(class [mscorlib]System.Func`2 f) cil managed + { + // Code size 16 (0x10) + .maxstack 4 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: stloc.0 + IL_0003: ldarg.1 + IL_0004: ldloc.0 + IL_0005: dup + IL_0006: ldc.i4.1 + IL_0007: add + IL_0008: stloc.0 + IL_0009: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_000e: pop + IL_000f: ret + } // end of method CompoundAssignmentTest::PostIncrementInlineLocalVariable + + .method public hidebysig instance int32 + PostDecrementArrayElement(int32[] 'array', + int32 pos) cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: ldelema [mscorlib]System.Int32 + IL_0008: dup + IL_0009: ldobj [mscorlib]System.Int32 + IL_000e: dup + IL_000f: stloc.1 + IL_0010: ldc.i4.1 + IL_0011: sub + IL_0012: stobj [mscorlib]System.Int32 + IL_0017: ldloc.1 + IL_0018: stloc.0 + IL_0019: br.s IL_001b + + IL_001b: ldloc.0 + IL_001c: ret + } // end of method CompoundAssignmentTest::PostDecrementArrayElement + + .method public hidebysig instance int32 + PostDecrementInstanceField() cil managed + { + // Code size 28 (0x1c) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000d: dup + IL_000e: stloc.1 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0016: ldloc.1 + IL_0017: stloc.0 + IL_0018: br.s IL_001a + + IL_001a: ldloc.0 + IL_001b: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceField + + .method public hidebysig instance int32 + PostDecrementInstanceProperty() cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000d: dup + IL_000e: stloc.1 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0016: nop + IL_0017: ldloc.1 + IL_0018: stloc.0 + IL_0019: br.s IL_001b + + IL_001b: ldloc.0 + IL_001c: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceProperty + + .method public hidebysig instance int32 + PostIncrement2DArray() cil managed + { + // Code size 43 (0x2b) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0007: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000c: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0011: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_0016: dup + IL_0017: ldobj [mscorlib]System.Int32 + IL_001c: dup + IL_001d: stloc.1 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: stobj [mscorlib]System.Int32 + IL_0025: ldloc.1 + IL_0026: stloc.0 + IL_0027: br.s IL_0029 + + IL_0029: ldloc.0 + IL_002a: ret + } // end of method CompoundAssignmentTest::PostIncrement2DArray + + .method public hidebysig instance int32 + PostIncrementByRef(int32& i) cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldind.i4 + IL_0004: dup + IL_0005: stloc.1 + IL_0006: ldc.i4.1 + IL_0007: add + IL_0008: stind.i4 + IL_0009: ldloc.1 + IL_000a: stloc.0 + IL_000b: br.s IL_000d + + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::PostIncrementByRef + + .method public hidebysig instance int32 + PostIncrementByPointer() cil managed + { + // Code size 20 (0x14) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0007: dup + IL_0008: ldind.i4 + IL_0009: dup + IL_000a: stloc.1 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stind.i4 + IL_000e: ldloc.1 + IL_000f: stloc.0 + IL_0010: br.s IL_0012 + + IL_0012: ldloc.0 + IL_0013: ret + } // end of method CompoundAssignmentTest::PostIncrementByPointer + .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.il index 4ca3fc14b..26c220096 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.il @@ -19873,6 +19873,404 @@ IL_005e: ret } // end of method CompoundAssignmentTest::StringPropertyCompoundAssign + .method public hidebysig instance int32 + PreIncrementByRef(int32& i) cil managed + { + // Code size 10 (0xa) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldind.i4 + IL_0003: ldc.i4.1 + IL_0004: add + IL_0005: dup + IL_0006: stloc.0 + IL_0007: stind.i4 + IL_0008: ldloc.0 + IL_0009: ret + } // end of method CompoundAssignmentTest::PreIncrementByRef + + .method public hidebysig instance int32 + PreIncrementByPointer() cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0006: dup + IL_0007: ldind.i4 + IL_0008: ldc.i4.1 + IL_0009: add + IL_000a: dup + IL_000b: stloc.0 + IL_000c: stind.i4 + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::PreIncrementByPointer + + .method public hidebysig instance int32 + PreIncrement2DArray() cil managed + { + // Code size 30 (0x1e) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0006: ldc.i4.1 + IL_0007: ldc.i4.2 + IL_0008: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000d: dup + IL_000e: ldobj [mscorlib]System.Int32 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: dup + IL_0016: stloc.0 + IL_0017: stobj [mscorlib]System.Int32 + IL_001c: ldloc.0 + IL_001d: ret + } // end of method CompoundAssignmentTest::PreIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignInstanceField() cil managed + { + // Code size 24 (0x18) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000c: ldc.i4.s 10 + IL_000e: mul + IL_000f: dup + IL_0010: stloc.0 + IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0016: ldloc.0 + IL_0017: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceField + + .method public hidebysig instance int32 + CompoundAssignInstanceProperty() cil managed + { + // Code size 24 (0x18) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000c: ldc.i4.s 10 + IL_000e: mul + IL_000f: dup + IL_0010: stloc.0 + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0016: ldloc.0 + IL_0017: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceProperty + + .method public hidebysig instance int32 + CompoundAssignStaticField() cil managed + { + // Code size 15 (0xf) + .maxstack 8 + IL_0000: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_0005: ldc.i4.s 100 + IL_0007: xor + IL_0008: dup + IL_0009: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000e: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticField + + .method public hidebysig instance int32 + CompoundAssignStaticProperty() cil managed + { + // Code size 15 (0xf) + .maxstack 8 + IL_0000: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0005: ldc.i4.s 10 + IL_0007: and + IL_0008: dup + IL_0009: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticProperty(int32) + IL_000e: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticProperty + + .method public hidebysig instance int32 + CompoundAssignArrayElement1(int32[] 'array', + int32 pos) cil managed + { + // Code size 25 (0x19) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: ldelema [mscorlib]System.Int32 + IL_0007: dup + IL_0008: ldobj [mscorlib]System.Int32 + IL_000d: ldc.i4.s 10 + IL_000f: mul + IL_0010: dup + IL_0011: stloc.0 + IL_0012: stobj [mscorlib]System.Int32 + IL_0017: ldloc.0 + IL_0018: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement1 + + .method public hidebysig instance int32 + CompoundAssignArrayElement2(int32[] 'array') cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: call int32 [mscorlib]System.Environment::get_TickCount() + IL_0006: ldelema [mscorlib]System.Int32 + IL_000b: dup + IL_000c: ldobj [mscorlib]System.Int32 + IL_0011: ldc.i4.s 10 + IL_0013: mul + IL_0014: dup + IL_0015: stloc.0 + IL_0016: stobj [mscorlib]System.Int32 + IL_001b: ldloc.0 + IL_001c: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement2 + + .method public hidebysig instance int32 + CompoundAssignIncrement2DArray() cil managed + { + // Code size 31 (0x1f) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0006: ldc.i4.1 + IL_0007: ldc.i4.2 + IL_0008: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000d: dup + IL_000e: ldobj [mscorlib]System.Int32 + IL_0013: ldc.i4.s 10 + IL_0015: rem + IL_0016: dup + IL_0017: stloc.0 + IL_0018: stobj [mscorlib]System.Int32 + IL_001d: ldloc.0 + IL_001e: ret + } // end of method CompoundAssignmentTest::CompoundAssignIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignByRef(int32& i) cil managed + { + // Code size 10 (0xa) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldind.i4 + IL_0003: ldc.i4.2 + IL_0004: shl + IL_0005: dup + IL_0006: stloc.0 + IL_0007: stind.i4 + IL_0008: ldloc.0 + IL_0009: ret + } // end of method CompoundAssignmentTest::CompoundAssignByRef + + .method public hidebysig instance float64 + CompoundAssignByPointer(float64* ptr) cil managed + { + // Code size 18 (0x12) + .maxstack 3 + .locals init (float64 V_0) + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldind.r8 + IL_0003: ldc.r8 1.5 + IL_000c: div + IL_000d: dup + IL_000e: stloc.0 + IL_000f: stind.r8 + IL_0010: ldloc.0 + IL_0011: ret + } // end of method CompoundAssignmentTest::CompoundAssignByPointer + + .method public hidebysig instance void + CompoundAssignEnum() cil managed + { + // Code size 30 (0x1e) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: dup + IL_0002: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0007: ldc.i4.2 + IL_0008: or + IL_0009: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_000e: ldarg.0 + IL_000f: dup + IL_0010: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0015: ldc.i4.s -5 + IL_0017: and + IL_0018: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_001d: ret + } // end of method CompoundAssignmentTest::CompoundAssignEnum + + .method public hidebysig instance int32 + PostIncrementInAddition(int32 i, + int32 j) cil managed + { + // Code size 9 (0x9) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldc.i4.1 + IL_0003: add + IL_0004: starg.s i + IL_0006: ldarg.2 + IL_0007: add + IL_0008: ret + } // end of method CompoundAssignmentTest::PostIncrementInAddition + + .method public hidebysig instance void + PostIncrementInlineLocalVariable(class [mscorlib]System.Func`2 f) cil managed + { + // Code size 15 (0xf) + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.1 + IL_0003: ldloc.0 + IL_0004: dup + IL_0005: ldc.i4.1 + IL_0006: add + IL_0007: stloc.0 + IL_0008: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_000d: pop + IL_000e: ret + } // end of method CompoundAssignmentTest::PostIncrementInlineLocalVariable + + .method public hidebysig instance int32 + PostDecrementArrayElement(int32[] 'array', + int32 pos) cil managed + { + // Code size 24 (0x18) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: ldelema [mscorlib]System.Int32 + IL_0007: dup + IL_0008: ldobj [mscorlib]System.Int32 + IL_000d: dup + IL_000e: stloc.0 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stobj [mscorlib]System.Int32 + IL_0016: ldloc.0 + IL_0017: ret + } // end of method CompoundAssignmentTest::PostDecrementArrayElement + + .method public hidebysig instance int32 + PostDecrementInstanceField() cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000c: dup + IL_000d: stloc.0 + IL_000e: ldc.i4.1 + IL_000f: sub + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0015: ldloc.0 + IL_0016: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceField + + .method public hidebysig instance int32 + PostDecrementInstanceProperty() cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000c: dup + IL_000d: stloc.0 + IL_000e: ldc.i4.1 + IL_000f: sub + IL_0010: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0015: ldloc.0 + IL_0016: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceProperty + + .method public hidebysig instance int32 + PostIncrement2DArray() cil managed + { + // Code size 38 (0x26) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0006: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000b: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0010: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_0015: dup + IL_0016: ldobj [mscorlib]System.Int32 + IL_001b: dup + IL_001c: stloc.0 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stobj [mscorlib]System.Int32 + IL_0024: ldloc.0 + IL_0025: ret + } // end of method CompoundAssignmentTest::PostIncrement2DArray + + .method public hidebysig instance int32 + PostIncrementByRef(int32& i) cil managed + { + // Code size 10 (0xa) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldind.i4 + IL_0003: dup + IL_0004: stloc.0 + IL_0005: ldc.i4.1 + IL_0006: add + IL_0007: stind.i4 + IL_0008: ldloc.0 + IL_0009: ret + } // end of method CompoundAssignmentTest::PostIncrementByRef + + .method public hidebysig instance int32 + PostIncrementByPointer() cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0006: dup + IL_0007: ldind.i4 + IL_0008: dup + IL_0009: stloc.0 + IL_000a: ldc.i4.1 + IL_000b: add + IL_000c: stind.i4 + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::PostIncrementByPointer + .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.roslyn.il index 87b2efcc1..6d60cf492 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.roslyn.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.opt.roslyn.il @@ -23219,6 +23219,404 @@ IL_005e: ret } // end of method CompoundAssignmentTest::StringPropertyCompoundAssign + .method public hidebysig instance int32 + PreIncrementByRef(int32& i) cil managed + { + // Code size 10 (0xa) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.1 + IL_0002: ldind.i4 + IL_0003: ldc.i4.1 + IL_0004: add + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: stind.i4 + IL_0008: ldloc.0 + IL_0009: ret + } // end of method CompoundAssignmentTest::PreIncrementByRef + + .method public hidebysig instance int32 + PreIncrementByPointer() cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0006: dup + IL_0007: ldind.i4 + IL_0008: ldc.i4.1 + IL_0009: add + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: stind.i4 + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::PreIncrementByPointer + + .method public hidebysig instance int32 + PreIncrement2DArray() cil managed + { + // Code size 22 (0x16) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0006: ldc.i4.1 + IL_0007: ldc.i4.2 + IL_0008: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000d: dup + IL_000e: ldind.i4 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: stind.i4 + IL_0014: ldloc.0 + IL_0015: ret + } // end of method CompoundAssignmentTest::PreIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignInstanceField() cil managed + { + // Code size 24 (0x18) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000c: ldc.i4.s 10 + IL_000e: mul + IL_000f: dup + IL_0010: stloc.0 + IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0016: ldloc.0 + IL_0017: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceField + + .method public hidebysig instance int32 + CompoundAssignInstanceProperty() cil managed + { + // Code size 24 (0x18) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000c: ldc.i4.s 10 + IL_000e: mul + IL_000f: dup + IL_0010: stloc.0 + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0016: ldloc.0 + IL_0017: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceProperty + + .method public hidebysig instance int32 + CompoundAssignStaticField() cil managed + { + // Code size 15 (0xf) + .maxstack 8 + IL_0000: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_0005: ldc.i4.s 100 + IL_0007: xor + IL_0008: dup + IL_0009: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000e: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticField + + .method public hidebysig instance int32 + CompoundAssignStaticProperty() cil managed + { + // Code size 15 (0xf) + .maxstack 8 + IL_0000: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0005: ldc.i4.s 10 + IL_0007: and + IL_0008: dup + IL_0009: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticProperty(int32) + IL_000e: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticProperty + + .method public hidebysig instance int32 + CompoundAssignArrayElement1(int32[] 'array', + int32 pos) cil managed + { + // Code size 17 (0x11) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: ldelema [mscorlib]System.Int32 + IL_0007: dup + IL_0008: ldind.i4 + IL_0009: ldc.i4.s 10 + IL_000b: mul + IL_000c: dup + IL_000d: stloc.0 + IL_000e: stind.i4 + IL_000f: ldloc.0 + IL_0010: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement1 + + .method public hidebysig instance int32 + CompoundAssignArrayElement2(int32[] 'array') cil managed + { + // Code size 21 (0x15) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: call int32 [mscorlib]System.Environment::get_TickCount() + IL_0006: ldelema [mscorlib]System.Int32 + IL_000b: dup + IL_000c: ldind.i4 + IL_000d: ldc.i4.s 10 + IL_000f: mul + IL_0010: dup + IL_0011: stloc.0 + IL_0012: stind.i4 + IL_0013: ldloc.0 + IL_0014: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement2 + + .method public hidebysig instance int32 + CompoundAssignIncrement2DArray() cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0006: ldc.i4.1 + IL_0007: ldc.i4.2 + IL_0008: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000d: dup + IL_000e: ldind.i4 + IL_000f: ldc.i4.s 10 + IL_0011: rem + IL_0012: dup + IL_0013: stloc.0 + IL_0014: stind.i4 + IL_0015: ldloc.0 + IL_0016: ret + } // end of method CompoundAssignmentTest::CompoundAssignIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignByRef(int32& i) cil managed + { + // Code size 10 (0xa) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.1 + IL_0002: ldind.i4 + IL_0003: ldc.i4.2 + IL_0004: shl + IL_0005: dup + IL_0006: stloc.0 + IL_0007: stind.i4 + IL_0008: ldloc.0 + IL_0009: ret + } // end of method CompoundAssignmentTest::CompoundAssignByRef + + .method public hidebysig instance float64 + CompoundAssignByPointer(float64* ptr) cil managed + { + // Code size 18 (0x12) + .maxstack 3 + .locals init (float64 V_0) + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldind.r8 + IL_0003: ldc.r8 1.5 + IL_000c: div + IL_000d: dup + IL_000e: stloc.0 + IL_000f: stind.r8 + IL_0010: ldloc.0 + IL_0011: ret + } // end of method CompoundAssignmentTest::CompoundAssignByPointer + + .method public hidebysig instance void + CompoundAssignEnum() cil managed + { + // Code size 30 (0x1e) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldarg.0 + IL_0002: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0007: ldc.i4.2 + IL_0008: or + IL_0009: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_000e: ldarg.0 + IL_000f: ldarg.0 + IL_0010: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0015: ldc.i4.s -5 + IL_0017: and + IL_0018: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_001d: ret + } // end of method CompoundAssignmentTest::CompoundAssignEnum + + .method public hidebysig instance int32 + PostIncrementInAddition(int32 i, + int32 j) cil managed + { + // Code size 9 (0x9) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: dup + IL_0002: ldc.i4.1 + IL_0003: add + IL_0004: starg.s i + IL_0006: ldarg.2 + IL_0007: add + IL_0008: ret + } // end of method CompoundAssignmentTest::PostIncrementInAddition + + .method public hidebysig instance void + PostIncrementInlineLocalVariable(class [mscorlib]System.Func`2 f) cil managed + { + // Code size 15 (0xf) + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldarg.1 + IL_0003: ldloc.0 + IL_0004: dup + IL_0005: ldc.i4.1 + IL_0006: add + IL_0007: stloc.0 + IL_0008: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_000d: pop + IL_000e: ret + } // end of method CompoundAssignmentTest::PostIncrementInlineLocalVariable + + .method public hidebysig instance int32 + PostDecrementArrayElement(int32[] 'array', + int32 pos) cil managed + { + // Code size 16 (0x10) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: ldelema [mscorlib]System.Int32 + IL_0007: dup + IL_0008: ldind.i4 + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: sub + IL_000d: stind.i4 + IL_000e: ldloc.0 + IL_000f: ret + } // end of method CompoundAssignmentTest::PostDecrementArrayElement + + .method public hidebysig instance int32 + PostDecrementInstanceField() cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.1 + IL_000f: sub + IL_0010: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0015: ldloc.0 + IL_0016: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceField + + .method public hidebysig instance int32 + PostDecrementInstanceProperty() cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0006: dup + IL_0007: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000c: stloc.0 + IL_000d: ldloc.0 + IL_000e: ldc.i4.1 + IL_000f: sub + IL_0010: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0015: ldloc.0 + IL_0016: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceProperty + + .method public hidebysig instance int32 + PostIncrement2DArray() cil managed + { + // Code size 30 (0x1e) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0006: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000b: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0010: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_0015: dup + IL_0016: ldind.i4 + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.1 + IL_001a: add + IL_001b: stind.i4 + IL_001c: ldloc.0 + IL_001d: ret + } // end of method CompoundAssignmentTest::PostIncrement2DArray + + .method public hidebysig instance int32 + PostIncrementByRef(int32& i) cil managed + { + // Code size 10 (0xa) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldarg.1 + IL_0002: ldind.i4 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldc.i4.1 + IL_0006: add + IL_0007: stind.i4 + IL_0008: ldloc.0 + IL_0009: ret + } // end of method CompoundAssignmentTest::PostIncrementByRef + + .method public hidebysig instance int32 + PostIncrementByPointer() cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0006: dup + IL_0007: ldind.i4 + IL_0008: stloc.0 + IL_0009: ldloc.0 + IL_000a: ldc.i4.1 + IL_000b: add + IL_000c: stind.i4 + IL_000d: ldloc.0 + IL_000e: ret + } // end of method CompoundAssignmentTest::PostIncrementByPointer + .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.roslyn.il index 94ed49489..71fd43ff4 100644 --- a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.roslyn.il +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CompoundAssignmentTest.roslyn.il @@ -25592,6 +25592,523 @@ IL_0063: ret } // end of method CompoundAssignmentTest::StringPropertyCompoundAssign + .method public hidebysig instance int32 + PreIncrementByRef(int32& i) cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.1 + IL_0003: ldind.i4 + IL_0004: ldc.i4.1 + IL_0005: add + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: stind.i4 + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: br.s IL_000d + + IL_000d: ldloc.1 + IL_000e: ret + } // end of method CompoundAssignmentTest::PreIncrementByRef + + .method public hidebysig instance int32 + PreIncrementByPointer() cil managed + { + // Code size 20 (0x14) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0007: dup + IL_0008: ldind.i4 + IL_0009: ldc.i4.1 + IL_000a: add + IL_000b: stloc.0 + IL_000c: ldloc.0 + IL_000d: stind.i4 + IL_000e: ldloc.0 + IL_000f: stloc.1 + IL_0010: br.s IL_0012 + + IL_0012: ldloc.1 + IL_0013: ret + } // end of method CompoundAssignmentTest::PreIncrementByPointer + + .method public hidebysig instance int32 + PreIncrement2DArray() cil managed + { + // Code size 27 (0x1b) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0007: ldc.i4.1 + IL_0008: ldc.i4.2 + IL_0009: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000e: dup + IL_000f: ldind.i4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stind.i4 + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: br.s IL_0019 + + IL_0019: ldloc.1 + IL_001a: ret + } // end of method CompoundAssignmentTest::PreIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignInstanceField() cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000d: ldc.i4.s 10 + IL_000f: mul + IL_0010: dup + IL_0011: stloc.0 + IL_0012: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0017: ldloc.0 + IL_0018: stloc.1 + IL_0019: br.s IL_001b + + IL_001b: ldloc.1 + IL_001c: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceField + + .method public hidebysig instance int32 + CompoundAssignInstanceProperty() cil managed + { + // Code size 30 (0x1e) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000d: ldc.i4.s 10 + IL_000f: mul + IL_0010: dup + IL_0011: stloc.0 + IL_0012: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0017: nop + IL_0018: ldloc.0 + IL_0019: stloc.1 + IL_001a: br.s IL_001c + + IL_001c: ldloc.1 + IL_001d: ret + } // end of method CompoundAssignmentTest::CompoundAssignInstanceProperty + + .method public hidebysig instance int32 + CompoundAssignStaticField() cil managed + { + // Code size 20 (0x14) + .maxstack 2 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_0006: ldc.i4.s 100 + IL_0008: xor + IL_0009: dup + IL_000a: stsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000f: stloc.0 + IL_0010: br.s IL_0012 + + IL_0012: ldloc.0 + IL_0013: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticField + + .method public hidebysig instance int32 + CompoundAssignStaticProperty() cil managed + { + // Code size 21 (0x15) + .maxstack 2 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0006: ldc.i4.s 10 + IL_0008: and + IL_0009: dup + IL_000a: call void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::set_StaticProperty(int32) + IL_000f: nop + IL_0010: stloc.0 + IL_0011: br.s IL_0013 + + IL_0013: ldloc.0 + IL_0014: ret + } // end of method CompoundAssignmentTest::CompoundAssignStaticProperty + + .method public hidebysig instance int32 + CompoundAssignArrayElement1(int32[] 'array', + int32 pos) cil managed + { + // Code size 22 (0x16) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: ldelema [mscorlib]System.Int32 + IL_0008: dup + IL_0009: ldind.i4 + IL_000a: ldc.i4.s 10 + IL_000c: mul + IL_000d: dup + IL_000e: stloc.0 + IL_000f: stind.i4 + IL_0010: ldloc.0 + IL_0011: stloc.1 + IL_0012: br.s IL_0014 + + IL_0014: ldloc.1 + IL_0015: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement1 + + .method public hidebysig instance int32 + CompoundAssignArrayElement2(int32[] 'array') cil managed + { + // Code size 26 (0x1a) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: call int32 [mscorlib]System.Environment::get_TickCount() + IL_0007: ldelema [mscorlib]System.Int32 + IL_000c: dup + IL_000d: ldind.i4 + IL_000e: ldc.i4.s 10 + IL_0010: mul + IL_0011: dup + IL_0012: stloc.0 + IL_0013: stind.i4 + IL_0014: ldloc.0 + IL_0015: stloc.1 + IL_0016: br.s IL_0018 + + IL_0018: ldloc.1 + IL_0019: ret + } // end of method CompoundAssignmentTest::CompoundAssignArrayElement2 + + .method public hidebysig instance int32 + CompoundAssignIncrement2DArray() cil managed + { + // Code size 28 (0x1c) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0007: ldc.i4.1 + IL_0008: ldc.i4.2 + IL_0009: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_000e: dup + IL_000f: ldind.i4 + IL_0010: ldc.i4.s 10 + IL_0012: rem + IL_0013: dup + IL_0014: stloc.0 + IL_0015: stind.i4 + IL_0016: ldloc.0 + IL_0017: stloc.1 + IL_0018: br.s IL_001a + + IL_001a: ldloc.1 + IL_001b: ret + } // end of method CompoundAssignmentTest::CompoundAssignIncrement2DArray + + .method public hidebysig instance int32 + CompoundAssignByRef(int32& i) cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.1 + IL_0003: ldind.i4 + IL_0004: ldc.i4.2 + IL_0005: shl + IL_0006: dup + IL_0007: stloc.0 + IL_0008: stind.i4 + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: br.s IL_000d + + IL_000d: ldloc.1 + IL_000e: ret + } // end of method CompoundAssignmentTest::CompoundAssignByRef + + .method public hidebysig instance float64 + CompoundAssignByPointer(float64* ptr) cil managed + { + // Code size 23 (0x17) + .maxstack 3 + .locals init (float64 V_0, + float64 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldind.r8 + IL_0004: ldc.r8 1.5 + IL_000d: div + IL_000e: dup + IL_000f: stloc.0 + IL_0010: stind.r8 + IL_0011: ldloc.0 + IL_0012: stloc.1 + IL_0013: br.s IL_0015 + + IL_0015: ldloc.1 + IL_0016: ret + } // end of method CompoundAssignmentTest::CompoundAssignByPointer + + .method public hidebysig instance void + CompoundAssignEnum() cil managed + { + // Code size 31 (0x1f) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldarg.0 + IL_0003: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0008: ldc.i4.2 + IL_0009: or + IL_000a: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_000f: ldarg.0 + IL_0010: ldarg.0 + IL_0011: ldfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_0016: ldc.i4.s -5 + IL_0018: and + IL_0019: stfld valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MyEnum ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::enumField + IL_001e: ret + } // end of method CompoundAssignmentTest::CompoundAssignEnum + + .method public hidebysig instance int32 + PostIncrementInAddition(int32 i, + int32 j) cil managed + { + // Code size 14 (0xe) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: dup + IL_0003: ldc.i4.1 + IL_0004: add + IL_0005: starg.s i + IL_0007: ldarg.2 + IL_0008: add + IL_0009: stloc.0 + IL_000a: br.s IL_000c + + IL_000c: ldloc.0 + IL_000d: ret + } // end of method CompoundAssignmentTest::PostIncrementInAddition + + .method public hidebysig instance void + PostIncrementInlineLocalVariable(class [mscorlib]System.Func`2 f) cil managed + { + // Code size 16 (0x10) + .maxstack 4 + .locals init (int32 V_0) + IL_0000: nop + IL_0001: ldc.i4.0 + IL_0002: stloc.0 + IL_0003: ldarg.1 + IL_0004: ldloc.0 + IL_0005: dup + IL_0006: ldc.i4.1 + IL_0007: add + IL_0008: stloc.0 + IL_0009: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_000e: pop + IL_000f: ret + } // end of method CompoundAssignmentTest::PostIncrementInlineLocalVariable + + .method public hidebysig instance int32 + PostDecrementArrayElement(int32[] 'array', + int32 pos) cil managed + { + // Code size 21 (0x15) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: ldelema [mscorlib]System.Int32 + IL_0008: dup + IL_0009: ldind.i4 + IL_000a: stloc.0 + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: sub + IL_000e: stind.i4 + IL_000f: ldloc.0 + IL_0010: stloc.1 + IL_0011: br.s IL_0013 + + IL_0013: ldloc.1 + IL_0014: ret + } // end of method CompoundAssignmentTest::PostDecrementArrayElement + + .method public hidebysig instance int32 + PostDecrementInstanceField() cil managed + { + // Code size 28 (0x1c) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::Field + IL_0016: ldloc.0 + IL_0017: stloc.1 + IL_0018: br.s IL_001a + + IL_001a: ldloc.1 + IL_001b: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceField + + .method public hidebysig instance int32 + PostDecrementInstanceProperty() cil managed + { + // Code size 29 (0x1d) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::M() + IL_0007: dup + IL_0008: callvirt instance int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::get_Property() + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: callvirt instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest/MutableClass::set_Property(int32) + IL_0016: nop + IL_0017: ldloc.0 + IL_0018: stloc.1 + IL_0019: br.s IL_001b + + IL_001b: ldloc.1 + IL_001c: ret + } // end of method CompoundAssignmentTest::PostDecrementInstanceProperty + + .method public hidebysig instance int32 + PostIncrement2DArray() cil managed + { + // Code size 35 (0x23) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32[0...,0...] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::Array() + IL_0007: ldsfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::StaticField + IL_000c: call int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::get_StaticProperty() + IL_0011: call instance int32& int32[0...,0...]::Address(int32, + int32) + IL_0016: dup + IL_0017: ldind.i4 + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: stind.i4 + IL_001d: ldloc.0 + IL_001e: stloc.1 + IL_001f: br.s IL_0021 + + IL_0021: ldloc.1 + IL_0022: ret + } // end of method CompoundAssignmentTest::PostIncrement2DArray + + .method public hidebysig instance int32 + PostIncrementByRef(int32& i) cil managed + { + // Code size 15 (0xf) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.1 + IL_0003: ldind.i4 + IL_0004: stloc.0 + IL_0005: ldloc.0 + IL_0006: ldc.i4.1 + IL_0007: add + IL_0008: stind.i4 + IL_0009: ldloc.0 + IL_000a: stloc.1 + IL_000b: br.s IL_000d + + IL_000d: ldloc.1 + IL_000e: ret + } // end of method CompoundAssignmentTest::PostIncrementByRef + + .method public hidebysig instance int32 + PostIncrementByPointer() cil managed + { + // Code size 20 (0x14) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: call instance int32* ICSharpCode.Decompiler.Tests.TestCases.Pretty.CompoundAssignmentTest::GetPointer() + IL_0007: dup + IL_0008: ldind.i4 + IL_0009: stloc.0 + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stind.i4 + IL_000e: ldloc.0 + IL_000f: stloc.1 + IL_0010: br.s IL_0012 + + IL_0012: ldloc.1 + IL_0013: ret + } // end of method CompoundAssignmentTest::PostIncrementByPointer + .method public hidebysig specialname rtspecialname instance void .ctor() cil managed {