From 907349d7e6a033b5e8eebf4be86ee0ef4aa965ae Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 16 Sep 2017 23:06:31 +0200 Subject: [PATCH] Add back CheckedUnchecked test case. --- .../BooleanConsumedAsInteger.il | 59 -- .../CheckedUnchecked.cs | 117 ---- .../ICSharpCode.Decompiler.Tests.csproj | 1 + .../PrettyTestRunner.cs | 9 + .../QueryExpressions.cs | 188 ----- .../TestCases/Pretty/CheckedUnchecked.cs | 108 +++ .../TestCases/Pretty/CheckedUnchecked.il | 637 +++++++++++++++++ .../TestCases/Pretty/CheckedUnchecked.opt.il | 551 +++++++++++++++ .../Pretty/CheckedUnchecked.opt.roslyn.il | 596 ++++++++++++++++ .../Pretty/CheckedUnchecked.roslyn.il | 647 ++++++++++++++++++ 10 files changed, 2549 insertions(+), 364 deletions(-) delete mode 100644 ICSharpCode.Decompiler.Tests/BooleanConsumedAsInteger.il delete mode 100644 ICSharpCode.Decompiler.Tests/CheckedUnchecked.cs delete mode 100644 ICSharpCode.Decompiler.Tests/QueryExpressions.cs create mode 100644 ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs create mode 100644 ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il create mode 100644 ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il create mode 100644 ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il create mode 100644 ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il diff --git a/ICSharpCode.Decompiler.Tests/BooleanConsumedAsInteger.il b/ICSharpCode.Decompiler.Tests/BooleanConsumedAsInteger.il deleted file mode 100644 index 9e3000279..000000000 --- a/ICSharpCode.Decompiler.Tests/BooleanConsumedAsInteger.il +++ /dev/null @@ -1,59 +0,0 @@ -.assembly extern mscorlib -{ - .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) - .ver 4:0:0:0 -} -.assembly BooleanConsumedAsInteger -{ - .hash algorithm 0x00008004 - .ver 1:0:0:0 -} -.module BooleanConsumedAsInteger.exe -.imagebase 0x00400000 -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 // WINDOWS_CUI -.corflags 0x00000003 // ILONLY 32BITREQUIRED - -.class private auto ansi beforefieldinit BooleanConsumedAsInteger.Program extends [mscorlib]System.Object -{ - .method public hidebysig static void Main(string[] args) cil managed - { - .entrypoint - .maxstack 8 - - ret - } - - .method public hidebysig static int32 ReturnBoolAsInt() cil managed - { - ldnull - ldnull - call bool [mscorlib] System.Object::Equals(object, object) - ret - } - - .method public hidebysig static int32 BitwiseOperationOnBool() cil managed - { - ldnull - ldnull - call bool [mscorlib] System.Object::Equals(object, object) - ldc.i4 255 - and - ret - } - - .method public hidebysig specialname rtspecialname - instance void .ctor() cil managed - { - // Code size 7 (0x7) - .maxstack 8 - IL_0000: ldarg.0 - IL_0001: call instance void [mscorlib]System.Object::.ctor() - IL_0006: ret - } // end of method Program::.ctor - -} // end of class StackTests.Program - - -// ============================================================= diff --git a/ICSharpCode.Decompiler.Tests/CheckedUnchecked.cs b/ICSharpCode.Decompiler.Tests/CheckedUnchecked.cs deleted file mode 100644 index fd1c4d89f..000000000 --- a/ICSharpCode.Decompiler.Tests/CheckedUnchecked.cs +++ /dev/null @@ -1,117 +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 CheckedUnchecked -{ - public int Operators(int a, int b) - { - int num = checked(a + b); - int num2 = a + b; - int num3 = checked(a - b); - int num4 = a - b; - int num5 = checked(a * b); - int num6 = a * b; - int num7 = a / b; - int num8 = a % b; - // The division operators / and % only exist in one form (checked vs. unchecked doesn't matter for them) - return num * num2 * num3 * num4 * num5 * num6 * num7 * num8; - } - - public int Cast(int a) - { - short num = checked((short)a); - short num2 = (short)a; - byte b = checked((byte)a); - byte b2 = (byte)a; - return num * num2 * b * b2; - } - - public void ForWithCheckedIteratorAndUncheckedBody(int n) - { - checked - { - for (int i = n + 1; i < n + 1; i++) - { - n = unchecked(i * i); - } - } - } - - public void ForWithCheckedInitializerAndUncheckedIterator(int n) - { - checked - { - int i = n; - for (i -= 10; i < n; i = unchecked(i + 1)) - { - n--; - } - } - } - public void ObjectCreationInitializerChecked() - { - this.TestHelp(new - { - x = 0, - l = 0 - }, n => checked(new - { - x = n.x + 1, - l = n.l + 1 - })); - } - - public void ObjectCreationWithOneFieldChecked() - { - this.TestHelp(new - { - x = 0, - l = 0 - }, n => new - { - x = checked(n.x + 1), - l = n.l + 1 - }); - } - - - public void ArrayInitializerChecked() - { - this.TestHelp(new int[] - { - 1, - 2 - }, (int[] n) => checked(new int[] - { - n[0] + 1, - n[1] + 1 - })); - } - - public T TestHelp(T t, Func f) - { - return f(t); - } - - public void CheckedInArrayCreationArgument(int a, int b) - { - Console.WriteLine(new int[checked(a + b)]); - } -} diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index f1e073bac..68c329f4d 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -59,6 +59,7 @@ + diff --git a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs index 4f46905ea..023480737 100644 --- a/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs +++ b/ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs @@ -145,6 +145,15 @@ namespace ICSharpCode.Decompiler.Tests Run(cscOptions: cscOptions); } + [Test] + public void CheckedUnchecked([ValueSource("defaultOptions")] CompilerOptions cscOptions) + { + if (cscOptions.HasFlag(CompilerOptions.UseRoslyn) && cscOptions.HasFlag(CompilerOptions.Optimize)) { + Assert.Ignore("Roslyn opt replaces locals with stack slots, resulting in S_* variable names."); + } + Run(cscOptions: cscOptions); + } + void Run([CallerMemberName] string testName = null, AssemblerOptions asmOptions = AssemblerOptions.None, CompilerOptions cscOptions = CompilerOptions.None) { var ilFile = Path.Combine(TestCasePath, testName); diff --git a/ICSharpCode.Decompiler.Tests/QueryExpressions.cs b/ICSharpCode.Decompiler.Tests/QueryExpressions.cs deleted file mode 100644 index d8b6e0623..000000000 --- a/ICSharpCode.Decompiler.Tests/QueryExpressions.cs +++ /dev/null @@ -1,188 +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; -using System.Collections.Generic; -using System.Linq; - -public class QueryExpressions -{ - public class Customer - { - public int CustomerID; - public IEnumerable Orders; - public string Name; - public string Country; - public string City; - } - - public class Order - { - public int OrderID; - public DateTime OrderDate; - public QueryExpressions.Customer Customer; - public int CustomerID; - public decimal Total; - public IEnumerable Details; - } - - public class OrderDetail - { - public decimal UnitPrice; - public int Quantity; - } - - public IEnumerable customers; - public IEnumerable orders; - - public object MultipleWhere() - { - return from c in this.customers - where c.Orders.Count() > 10 - where c.Country == "DE" - select c; - } - - public object SelectManyFollowedBySelect() - { - return from c in this.customers - from o in c.Orders - select new - { - c.Name, - o.OrderID, - o.Total - }; - } - - public object SelectManyFollowedByOrderBy() - { - return from c in this.customers - from o in c.Orders - orderby o.Total descending - select new - { - c.Name, - o.OrderID, - o.Total - }; - } - - public object MultipleSelectManyFollowedBySelect() - { - return from c in this.customers - from o in c.Orders - from d in o.Details - select new - { - c.Name, - o.OrderID, - d.Quantity - }; - } - - public object MultipleSelectManyFollowedByLet() - { - return from c in this.customers - from o in c.Orders - from d in o.Details - let x = d.Quantity * d.UnitPrice - select new - { - c.Name, - o.OrderID, - x - }; - } - - public object FromLetWhereSelect() - { - return from o in this.orders - let t = o.Details.Sum((QueryExpressions.OrderDetail d) => d.UnitPrice * d.Quantity) - where t >= 1000m - select new - { - OrderID = o.OrderID, - Total = t - }; - } - - public object MultipleLet() - { - return from a in this.customers - let b = a.Country - let c = a.Name - select b + c; - } - - public object Join() - { - return from c in this.customers - join o in this.orders on c.CustomerID equals o.CustomerID - select new - { - c.Name, - o.OrderDate, - o.Total - }; - } - - public object JoinInto() - { - return from c in this.customers - join o in this.orders on c.CustomerID equals o.CustomerID into co - let n = co.Count() - where n >= 10 - select new - { - Name = c.Name, - OrderCount = n - }; - } - - public object OrderBy() - { - return from o in this.orders - orderby o.Customer.Name, o.Total descending - select o; - } - - public object GroupBy() - { - return from c in this.customers - group c.Name by c.Country; - } - - public object ExplicitType() - { - return from QueryExpressions.Customer c in this.customers - where c.City == "London" - select c; - } - - public object QueryContinuation() - { - return from c in this.customers - group c by c.Country into g - select new - { - Country = g.Key, - CustCount = g.Count() - }; - } -} diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs new file mode 100644 index 000000000..45c576f84 --- /dev/null +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.cs @@ -0,0 +1,108 @@ +// 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; + +namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty +{ + public class CheckedUnchecked + { + public int Operators(int a, int b) + { + int num = checked(a + b); + int num2 = a + b; + int num3 = checked(a - b); + int num4 = a - b; + int num5 = checked(a * b); + int num6 = a * b; + int num7 = a / b; + int num8 = a % b; + // The division operators / and % only exist in one form (checked vs. unchecked doesn't matter for them) + return num * num2 * num3 * num4 * num5 * num6 * num7 * num8; + } + + public int Cast(int a) + { + short num = checked((short)a); + short num2 = (short)a; + byte b = checked((byte)a); + byte b2 = (byte)a; + return num * num2 * b * b2; + } + + public void ForWithCheckedIteratorAndUncheckedBody(int n) + { + checked { + for (int i = n + 1; i < n + 1; i++) { + n = unchecked(i * i); + } + } + } + + public void ForWithCheckedInitializerAndUncheckedIterator(int n) + { + int num = n; + for (num = checked(num - 10); num < n; num++) { + n--; + } + } + public void ObjectCreationInitializerChecked() + { + this.TestHelp(new { + x = 0, + l = 0 + }, n => checked(new { + x = n.x + 1, + l = n.l + 1 + })); + } + + public void ObjectCreationWithOneFieldChecked() + { + this.TestHelp(new { + x = 0, + l = 0 + }, n => new { + x = checked(n.x + 1), + l = n.l + 1 + }); + } + + + public void ArrayInitializerChecked() + { + this.TestHelp(new int[2] { + 1, + 2 + }, (Func)((int[] n) => checked(new int[2] { + n[0] + 1, + n[1] + 1 + }))); + } + + public T TestHelp(T t, Func f) + { + return f.Invoke(t); + } + + public void CheckedInArrayCreationArgument(int a, int b) + { + Console.WriteLine(new int[checked(a + b)]); + } + } +} diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il new file mode 100644 index 000000000..6e94340ff --- /dev/null +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.il @@ -0,0 +1,637 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.18020 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly rbj4xpgi +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + .permissionset reqmin + = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module rbj4xpgi.dll +// MVID: {45787808-282D-44B8-BFE5-F8F3EF6DDA83} +.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x005F0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + extends [mscorlib]System.Object +{ + .field private static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> 'CS$<>9__CachedAnonymousMethodDelegate1' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> 'CS$<>9__CachedAnonymousMethodDelegate3' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private static class [mscorlib]System.Func`2 'CS$<>9__CachedAnonymousMethodDelegate5' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .method public hidebysig instance int32 + Operators(int32 a, + int32 b) cil managed + { + // Code size 63 (0x3f) + .maxstack 2 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32 V_3, + int32 V_4, + int32 V_5, + int32 V_6, + int32 V_7, + int32 V_8) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: add.ovf + IL_0004: stloc.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: add + IL_0008: stloc.1 + IL_0009: ldarg.1 + IL_000a: ldarg.2 + IL_000b: sub.ovf + IL_000c: stloc.2 + IL_000d: ldarg.1 + IL_000e: ldarg.2 + IL_000f: sub + IL_0010: stloc.3 + IL_0011: ldarg.1 + IL_0012: ldarg.2 + IL_0013: mul.ovf + IL_0014: stloc.s V_4 + IL_0016: ldarg.1 + IL_0017: ldarg.2 + IL_0018: mul + IL_0019: stloc.s V_5 + IL_001b: ldarg.1 + IL_001c: ldarg.2 + IL_001d: div + IL_001e: stloc.s V_6 + IL_0020: ldarg.1 + IL_0021: ldarg.2 + IL_0022: rem + IL_0023: stloc.s V_7 + IL_0025: ldloc.0 + IL_0026: ldloc.1 + IL_0027: mul + IL_0028: ldloc.2 + IL_0029: mul + IL_002a: ldloc.3 + IL_002b: mul + IL_002c: ldloc.s V_4 + IL_002e: mul + IL_002f: ldloc.s V_5 + IL_0031: mul + IL_0032: ldloc.s V_6 + IL_0034: mul + IL_0035: ldloc.s V_7 + IL_0037: mul + IL_0038: stloc.s V_8 + IL_003a: br.s IL_003c + + IL_003c: ldloc.s V_8 + IL_003e: ret + } // end of method CheckedUnchecked::Operators + + .method public hidebysig instance int32 + Cast(int32 a) cil managed + { + // Code size 27 (0x1b) + .maxstack 2 + .locals init (int16 V_0, + int16 V_1, + uint8 V_2, + uint8 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: conv.ovf.i2 + IL_0003: stloc.0 + IL_0004: ldarg.1 + IL_0005: conv.i2 + IL_0006: stloc.1 + IL_0007: ldarg.1 + IL_0008: conv.ovf.u1 + IL_0009: stloc.2 + IL_000a: ldarg.1 + IL_000b: conv.u1 + IL_000c: stloc.3 + IL_000d: ldloc.0 + IL_000e: ldloc.1 + IL_000f: mul + IL_0010: ldloc.2 + IL_0011: mul + IL_0012: ldloc.3 + IL_0013: mul + IL_0014: stloc.s V_4 + IL_0016: br.s IL_0018 + + IL_0018: ldloc.s V_4 + IL_001a: ret + } // end of method CheckedUnchecked::Cast + + .method public hidebysig instance void + ForWithCheckedIteratorAndUncheckedBody(int32 n) cil managed + { + // Code size 31 (0x1f) + .maxstack 3 + .locals init (int32 V_0, + bool V_1) + IL_0000: nop + IL_0001: nop + IL_0002: ldarg.1 + IL_0003: ldc.i4.1 + IL_0004: add.ovf + IL_0005: stloc.0 + IL_0006: br.s IL_0013 + + IL_0008: nop + IL_0009: ldloc.0 + IL_000a: ldloc.0 + IL_000b: mul + IL_000c: starg.s n + IL_000e: nop + IL_000f: ldloc.0 + IL_0010: ldc.i4.1 + IL_0011: add.ovf + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: ldarg.1 + IL_0015: ldc.i4.1 + IL_0016: add.ovf + IL_0017: clt + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: brtrue.s IL_0008 + + IL_001d: nop + IL_001e: ret + } // end of method CheckedUnchecked::ForWithCheckedIteratorAndUncheckedBody + + .method public hidebysig instance void + ForWithCheckedInitializerAndUncheckedIterator(int32 n) cil managed + { + // Code size 30 (0x1e) + .maxstack 2 + .locals init (int32 V_0, + bool V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: stloc.0 + IL_0003: ldloc.0 + IL_0004: ldc.i4.s 10 + IL_0006: sub.ovf + IL_0007: stloc.0 + IL_0008: br.s IL_0015 + + IL_000a: nop + IL_000b: ldarg.1 + IL_000c: ldc.i4.1 + IL_000d: sub + IL_000e: starg.s n + IL_0010: nop + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldarg.1 + IL_0017: clt + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: brtrue.s IL_000a + + IL_001d: ret + } // end of method CheckedUnchecked::ForWithCheckedInitializerAndUncheckedIterator + + .method public hidebysig instance void + ObjectCreationInitializerChecked() cil managed + { + // Code size 47 (0x2f) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.0 + IL_0003: ldc.i4.0 + IL_0004: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0009: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate1' + IL_000e: brtrue.s IL_0023 + + IL_0010: ldnull + IL_0011: ldftn class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'b__0'(class '<>f__AnonymousType0`2') + IL_0017: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_001c: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate1' + IL_0021: br.s IL_0023 + + IL_0023: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate1' + IL_0028: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002d: pop + IL_002e: ret + } // end of method CheckedUnchecked::ObjectCreationInitializerChecked + + .method public hidebysig instance void + ObjectCreationWithOneFieldChecked() cil managed + { + // Code size 47 (0x2f) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.0 + IL_0003: ldc.i4.0 + IL_0004: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0009: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate3' + IL_000e: brtrue.s IL_0023 + + IL_0010: ldnull + IL_0011: ldftn class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'b__2'(class '<>f__AnonymousType0`2') + IL_0017: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_001c: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate3' + IL_0021: br.s IL_0023 + + IL_0023: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate3' + IL_0028: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002d: pop + IL_002e: ret + } // end of method CheckedUnchecked::ObjectCreationWithOneFieldChecked + + .method public hidebysig instance void + ArrayInitializerChecked() cil managed + { + // Code size 56 (0x38) + .maxstack 4 + .locals init (int32[] V_0) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.2 + IL_0003: newarr [mscorlib]System.Int32 + IL_0008: stloc.0 + IL_0009: ldloc.0 + IL_000a: ldc.i4.0 + IL_000b: ldc.i4.1 + IL_000c: stelem.i4 + IL_000d: ldloc.0 + IL_000e: ldc.i4.1 + IL_000f: ldc.i4.2 + IL_0010: stelem.i4 + IL_0011: ldloc.0 + IL_0012: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate5' + IL_0017: brtrue.s IL_002c + + IL_0019: ldnull + IL_001a: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'b__4'(int32[]) + IL_0020: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0025: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate5' + IL_002a: br.s IL_002c + + IL_002c: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate5' + IL_0031: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelp(!!0, + class [mscorlib]System.Func`2) + IL_0036: pop + IL_0037: ret + } // end of method CheckedUnchecked::ArrayInitializerChecked + + .method public hidebysig instance !!T TestHelp(!!T t, + class [mscorlib]System.Func`2 f) cil managed + { + // Code size 13 (0xd) + .maxstack 2 + .locals init (!!T V_0) + IL_0000: nop + IL_0001: ldarg.2 + IL_0002: ldarg.1 + IL_0003: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_0008: stloc.0 + IL_0009: br.s IL_000b + + IL_000b: ldloc.0 + IL_000c: ret + } // end of method CheckedUnchecked::TestHelp + + .method public hidebysig instance void + CheckedInArrayCreationArgument(int32 a, + int32 b) cil managed + { + // Code size 16 (0x10) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: add.ovf + IL_0004: newarr [mscorlib]System.Int32 + IL_0009: call void [mscorlib]System.Console::WriteLine(object) + IL_000e: nop + IL_000f: ret + } // end of method CheckedUnchecked::CheckedInArrayCreationArgument + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } // end of method CheckedUnchecked::.ctor + + .method private hidebysig static class '<>f__AnonymousType0`2' + 'b__0'(class '<>f__AnonymousType0`2' n) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 26 (0x1a) + .maxstack 3 + .locals init (class '<>f__AnonymousType0`2' V_0) + IL_0000: ldarg.0 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.0 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add.ovf + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: stloc.0 + IL_0016: br.s IL_0018 + + IL_0018: ldloc.0 + IL_0019: ret + } // end of method CheckedUnchecked::'b__0' + + .method private hidebysig static class '<>f__AnonymousType0`2' + 'b__2'(class '<>f__AnonymousType0`2' n) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 26 (0x1a) + .maxstack 3 + .locals init (class '<>f__AnonymousType0`2' V_0) + IL_0000: ldarg.0 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.0 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: stloc.0 + IL_0016: br.s IL_0018 + + IL_0018: ldloc.0 + IL_0019: ret + } // end of method CheckedUnchecked::'b__2' + + .method private hidebysig static int32[] + 'b__4'(int32[] n) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 29 (0x1d) + .maxstack 4 + .locals init (int32[] V_0, + int32[] V_1) + IL_0000: ldc.i4.2 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.1 + IL_0007: ldloc.1 + IL_0008: ldc.i4.0 + IL_0009: ldarg.0 + IL_000a: ldc.i4.0 + IL_000b: ldelem.i4 + IL_000c: ldc.i4.1 + IL_000d: add.ovf + IL_000e: stelem.i4 + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: ldarg.0 + IL_0012: ldc.i4.1 + IL_0013: ldelem.i4 + IL_0014: ldc.i4.1 + IL_0015: add.ovf + IL_0016: stelem.i4 + IL_0017: ldloc.1 + IL_0018: stloc.0 + IL_0019: br.s IL_001b + + IL_001b: ldloc.0 + IL_001c: ret + } // end of method CheckedUnchecked::'b__4' + +} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + +.class private auto ansi sealed beforefieldinit '<>f__AnonymousType0`2'<'j__TPar','j__TPar'> + extends [mscorlib]System.Object +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname + instance void .ctor(!'j__TPar' x, + !'j__TPar' l) cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0014: ret + } // end of method '<>f__AnonymousType0`2'::.ctor + + .method public hidebysig specialname instance !'j__TPar' + get_x() cil managed + { + // Code size 11 (0xb) + .maxstack 1 + .locals init (!'j__TPar' V_0) + IL_0000: ldarg.0 + IL_0001: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: stloc.0 + IL_0007: br.s IL_0009 + + IL_0009: ldloc.0 + IL_000a: ret + } // end of method '<>f__AnonymousType0`2'::get_x + + .method public hidebysig specialname instance !'j__TPar' + get_l() cil managed + { + // Code size 11 (0xb) + .maxstack 1 + .locals init (!'j__TPar' V_0) + IL_0000: ldarg.0 + IL_0001: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: stloc.0 + IL_0007: br.s IL_0009 + + IL_0009: ldloc.0 + IL_000a: ret + } // end of method '<>f__AnonymousType0`2'::get_l + + .method public hidebysig virtual instance string + ToString() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 89 (0x59) + .maxstack 2 + .locals init (class [mscorlib]System.Text.StringBuilder V_0, + string V_1) + IL_0000: newobj instance void [mscorlib]System.Text.StringBuilder::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldstr "{ x = " + IL_000c: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(string) + IL_0011: pop + IL_0012: ldloc.0 + IL_0013: ldarg.0 + IL_0014: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0019: box !'j__TPar' + IL_001e: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(object) + IL_0023: pop + IL_0024: ldloc.0 + IL_0025: ldstr ", l = " + IL_002a: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(string) + IL_002f: pop + IL_0030: ldloc.0 + IL_0031: ldarg.0 + IL_0032: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0037: box !'j__TPar' + IL_003c: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(object) + IL_0041: pop + IL_0042: ldloc.0 + IL_0043: ldstr " }" + IL_0048: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(string) + IL_004d: pop + IL_004e: ldloc.0 + IL_004f: callvirt instance string [mscorlib]System.Object::ToString() + IL_0054: stloc.1 + IL_0055: br.s IL_0057 + + IL_0057: ldloc.1 + IL_0058: ret + } // end of method '<>f__AnonymousType0`2'::ToString + + .method public hidebysig virtual instance bool + Equals(object 'value') cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 65 (0x41) + .maxstack 3 + .locals init (class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> V_0, + bool V_1) + IL_0000: ldarg.1 + IL_0001: isinst class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_003a + + IL_000a: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_000f: ldarg.0 + IL_0010: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0015: ldloc.0 + IL_0016: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_001b: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0020: brfalse.s IL_003a + + IL_0022: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0027: ldarg.0 + IL_0028: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_002d: ldloc.0 + IL_002e: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0033: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0038: br.s IL_003b + + IL_003a: ldc.i4.0 + IL_003b: nop + IL_003c: stloc.1 + IL_003d: br.s IL_003f + + IL_003f: ldloc.1 + IL_0040: ret + } // end of method '<>f__AnonymousType0`2'::Equals + + .method public hidebysig virtual instance int32 + GetHashCode() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 62 (0x3e) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4 0xf749ae7d + IL_0005: stloc.0 + IL_0006: ldc.i4 0xa5555529 + IL_000b: ldloc.0 + IL_000c: mul + IL_000d: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0012: ldarg.0 + IL_0013: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0018: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_001d: add + IL_001e: stloc.0 + IL_001f: ldc.i4 0xa5555529 + IL_0024: ldloc.0 + IL_0025: mul + IL_0026: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_002b: ldarg.0 + IL_002c: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0031: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: stloc.1 + IL_003a: br.s IL_003c + + IL_003c: ldloc.1 + IL_003d: ret + } // end of method '<>f__AnonymousType0`2'::GetHashCode + + .property instance !'j__TPar' x() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_x() + } // end of property '<>f__AnonymousType0`2'::x + .property instance !'j__TPar' l() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_l() + } // end of property '<>f__AnonymousType0`2'::l +} // end of class '<>f__AnonymousType0`2' + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file ../../../TestCases/Pretty\CheckedUnchecked.res diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il new file mode 100644 index 000000000..7066cd143 --- /dev/null +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.il @@ -0,0 +1,551 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.18020 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly j4foxgdl +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + .permissionset reqmin + = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module j4foxgdl.dll +// MVID: {C884AA00-D1B2-4593-9A69-3DBFE92E25C4} +.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x02F90000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + extends [mscorlib]System.Object +{ + .field private static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> 'CS$<>9__CachedAnonymousMethodDelegate1' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> 'CS$<>9__CachedAnonymousMethodDelegate3' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private static class [mscorlib]System.Func`2 'CS$<>9__CachedAnonymousMethodDelegate5' + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .method public hidebysig instance int32 + Operators(int32 a, + int32 b) cil managed + { + // Code size 56 (0x38) + .maxstack 2 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32 V_3, + int32 V_4, + int32 V_5, + int32 V_6, + int32 V_7) + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf + IL_0003: stloc.0 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: add + IL_0007: stloc.1 + IL_0008: ldarg.1 + IL_0009: ldarg.2 + IL_000a: sub.ovf + IL_000b: stloc.2 + IL_000c: ldarg.1 + IL_000d: ldarg.2 + IL_000e: sub + IL_000f: stloc.3 + IL_0010: ldarg.1 + IL_0011: ldarg.2 + IL_0012: mul.ovf + IL_0013: stloc.s V_4 + IL_0015: ldarg.1 + IL_0016: ldarg.2 + IL_0017: mul + IL_0018: stloc.s V_5 + IL_001a: ldarg.1 + IL_001b: ldarg.2 + IL_001c: div + IL_001d: stloc.s V_6 + IL_001f: ldarg.1 + IL_0020: ldarg.2 + IL_0021: rem + IL_0022: stloc.s V_7 + IL_0024: ldloc.0 + IL_0025: ldloc.1 + IL_0026: mul + IL_0027: ldloc.2 + IL_0028: mul + IL_0029: ldloc.3 + IL_002a: mul + IL_002b: ldloc.s V_4 + IL_002d: mul + IL_002e: ldloc.s V_5 + IL_0030: mul + IL_0031: ldloc.s V_6 + IL_0033: mul + IL_0034: ldloc.s V_7 + IL_0036: mul + IL_0037: ret + } // end of method CheckedUnchecked::Operators + + .method public hidebysig instance int32 + Cast(int32 a) cil managed + { + // Code size 20 (0x14) + .maxstack 2 + .locals init (int16 V_0, + int16 V_1, + uint8 V_2, + uint8 V_3) + IL_0000: ldarg.1 + IL_0001: conv.ovf.i2 + IL_0002: stloc.0 + IL_0003: ldarg.1 + IL_0004: conv.i2 + IL_0005: stloc.1 + IL_0006: ldarg.1 + IL_0007: conv.ovf.u1 + IL_0008: stloc.2 + IL_0009: ldarg.1 + IL_000a: conv.u1 + IL_000b: stloc.3 + IL_000c: ldloc.0 + IL_000d: ldloc.1 + IL_000e: mul + IL_000f: ldloc.2 + IL_0010: mul + IL_0011: ldloc.3 + IL_0012: mul + IL_0013: ret + } // end of method CheckedUnchecked::Cast + + .method public hidebysig instance void + ForWithCheckedIteratorAndUncheckedBody(int32 n) cil managed + { + // Code size 22 (0x16) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldc.i4.1 + IL_0002: add.ovf + IL_0003: stloc.0 + IL_0004: br.s IL_000f + + IL_0006: ldloc.0 + IL_0007: ldloc.0 + IL_0008: mul + IL_0009: starg.s n + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: add.ovf + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldarg.1 + IL_0011: ldc.i4.1 + IL_0012: add.ovf + IL_0013: blt.s IL_0006 + + IL_0015: ret + } // end of method CheckedUnchecked::ForWithCheckedIteratorAndUncheckedBody + + .method public hidebysig instance void + ForWithCheckedInitializerAndUncheckedIterator(int32 n) cil managed + { + // Code size 23 (0x17) + .maxstack 2 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: sub.ovf + IL_0006: stloc.0 + IL_0007: br.s IL_0012 + + IL_0009: ldarg.1 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: starg.s n + IL_000e: ldloc.0 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: ldarg.1 + IL_0014: blt.s IL_0009 + + IL_0016: ret + } // end of method CheckedUnchecked::ForWithCheckedInitializerAndUncheckedIterator + + .method public hidebysig instance void + ObjectCreationInitializerChecked() cil managed + { + // Code size 44 (0x2c) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.0 + IL_0003: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0008: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate1' + IL_000d: brtrue.s IL_0020 + + IL_000f: ldnull + IL_0010: ldftn class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'b__0'(class '<>f__AnonymousType0`2') + IL_0016: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_001b: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate1' + IL_0020: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate1' + IL_0025: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002a: pop + IL_002b: ret + } // end of method CheckedUnchecked::ObjectCreationInitializerChecked + + .method public hidebysig instance void + ObjectCreationWithOneFieldChecked() cil managed + { + // Code size 44 (0x2c) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.0 + IL_0003: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0008: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate3' + IL_000d: brtrue.s IL_0020 + + IL_000f: ldnull + IL_0010: ldftn class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'b__2'(class '<>f__AnonymousType0`2') + IL_0016: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_001b: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate3' + IL_0020: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate3' + IL_0025: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002a: pop + IL_002b: ret + } // end of method CheckedUnchecked::ObjectCreationWithOneFieldChecked + + .method public hidebysig instance void + ArrayInitializerChecked() cil managed + { + // Code size 53 (0x35) + .maxstack 4 + .locals init (int32[] V_0) + IL_0000: ldarg.0 + IL_0001: ldc.i4.2 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.0 + IL_000a: ldc.i4.1 + IL_000b: stelem.i4 + IL_000c: ldloc.0 + IL_000d: ldc.i4.1 + IL_000e: ldc.i4.2 + IL_000f: stelem.i4 + IL_0010: ldloc.0 + IL_0011: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate5' + IL_0016: brtrue.s IL_0029 + + IL_0018: ldnull + IL_0019: ldftn int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'b__4'(int32[]) + IL_001f: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0024: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate5' + IL_0029: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::'CS$<>9__CachedAnonymousMethodDelegate5' + IL_002e: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelp(!!0, + class [mscorlib]System.Func`2) + IL_0033: pop + IL_0034: ret + } // end of method CheckedUnchecked::ArrayInitializerChecked + + .method public hidebysig instance !!T TestHelp(!!T t, + class [mscorlib]System.Func`2 f) cil managed + { + // Code size 8 (0x8) + .maxstack 8 + IL_0000: ldarg.2 + IL_0001: ldarg.1 + IL_0002: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_0007: ret + } // end of method CheckedUnchecked::TestHelp + + .method public hidebysig instance void + CheckedInArrayCreationArgument(int32 a, + int32 b) cil managed + { + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf + IL_0003: newarr [mscorlib]System.Int32 + IL_0008: call void [mscorlib]System.Console::WriteLine(object) + IL_000d: ret + } // end of method CheckedUnchecked::CheckedInArrayCreationArgument + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } // end of method CheckedUnchecked::.ctor + + .method private hidebysig static class '<>f__AnonymousType0`2' + 'b__0'(class '<>f__AnonymousType0`2' n) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.0 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add.ovf + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: ret + } // end of method CheckedUnchecked::'b__0' + + .method private hidebysig static class '<>f__AnonymousType0`2' + 'b__2'(class '<>f__AnonymousType0`2' n) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.0 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: ret + } // end of method CheckedUnchecked::'b__2' + + .method private hidebysig static int32[] + 'b__4'(int32[] n) cil managed + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 25 (0x19) + .maxstack 4 + .locals init (int32[] V_0) + IL_0000: ldc.i4.2 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: ldc.i4.0 + IL_0009: ldarg.0 + IL_000a: ldc.i4.0 + IL_000b: ldelem.i4 + IL_000c: ldc.i4.1 + IL_000d: add.ovf + IL_000e: stelem.i4 + IL_000f: ldloc.0 + IL_0010: ldc.i4.1 + IL_0011: ldarg.0 + IL_0012: ldc.i4.1 + IL_0013: ldelem.i4 + IL_0014: ldc.i4.1 + IL_0015: add.ovf + IL_0016: stelem.i4 + IL_0017: ldloc.0 + IL_0018: ret + } // end of method CheckedUnchecked::'b__4' + +} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + +.class private auto ansi sealed beforefieldinit '<>f__AnonymousType0`2'<'j__TPar','j__TPar'> + extends [mscorlib]System.Object +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname rtspecialname + instance void .ctor(!'j__TPar' x, + !'j__TPar' l) cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0014: ret + } // end of method '<>f__AnonymousType0`2'::.ctor + + .method public hidebysig specialname instance !'j__TPar' + get_x() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: ret + } // end of method '<>f__AnonymousType0`2'::get_x + + .method public hidebysig specialname instance !'j__TPar' + get_l() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: ret + } // end of method '<>f__AnonymousType0`2'::get_l + + .method public hidebysig virtual instance string + ToString() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 85 (0x55) + .maxstack 2 + .locals init (class [mscorlib]System.Text.StringBuilder V_0) + IL_0000: newobj instance void [mscorlib]System.Text.StringBuilder::.ctor() + IL_0005: stloc.0 + IL_0006: ldloc.0 + IL_0007: ldstr "{ x = " + IL_000c: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(string) + IL_0011: pop + IL_0012: ldloc.0 + IL_0013: ldarg.0 + IL_0014: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0019: box !'j__TPar' + IL_001e: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(object) + IL_0023: pop + IL_0024: ldloc.0 + IL_0025: ldstr ", l = " + IL_002a: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(string) + IL_002f: pop + IL_0030: ldloc.0 + IL_0031: ldarg.0 + IL_0032: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0037: box !'j__TPar' + IL_003c: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(object) + IL_0041: pop + IL_0042: ldloc.0 + IL_0043: ldstr " }" + IL_0048: callvirt instance class [mscorlib]System.Text.StringBuilder [mscorlib]System.Text.StringBuilder::Append(string) + IL_004d: pop + IL_004e: ldloc.0 + IL_004f: callvirt instance string [mscorlib]System.Object::ToString() + IL_0054: ret + } // end of method '<>f__AnonymousType0`2'::ToString + + .method public hidebysig virtual instance bool + Equals(object 'value') cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 59 (0x3b) + .maxstack 3 + .locals init (class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> V_0) + IL_0000: ldarg.1 + IL_0001: isinst class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0039 + + IL_000a: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_000f: ldarg.0 + IL_0010: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0015: ldloc.0 + IL_0016: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_001b: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0020: brfalse.s IL_0039 + + IL_0022: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0027: ldarg.0 + IL_0028: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_002d: ldloc.0 + IL_002e: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0033: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0038: ret + + IL_0039: ldc.i4.0 + IL_003a: ret + } // end of method '<>f__AnonymousType0`2'::Equals + + .method public hidebysig virtual instance int32 + GetHashCode() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 58 (0x3a) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldc.i4 0xf749ae7d + IL_0005: stloc.0 + IL_0006: ldc.i4 0xa5555529 + IL_000b: ldloc.0 + IL_000c: mul + IL_000d: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0012: ldarg.0 + IL_0013: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0018: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_001d: add + IL_001e: stloc.0 + IL_001f: ldc.i4 0xa5555529 + IL_0024: ldloc.0 + IL_0025: mul + IL_0026: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_002b: ldarg.0 + IL_002c: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0031: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ret + } // end of method '<>f__AnonymousType0`2'::GetHashCode + + .property instance !'j__TPar' x() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_x() + } // end of property '<>f__AnonymousType0`2'::x + .property instance !'j__TPar' l() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_l() + } // end of property '<>f__AnonymousType0`2'::l +} // end of class '<>f__AnonymousType0`2' + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** +// WARNING: Created Win32 resource file ../../../TestCases/Pretty\CheckedUnchecked.opt.res diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il new file mode 100644 index 000000000..af10b5a23 --- /dev/null +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.opt.roslyn.il @@ -0,0 +1,596 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.18020 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly CheckedUnchecked +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 02 00 00 00 00 00 ) + + .permissionset reqmin + = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module CheckedUnchecked.dll +// MVID: {BE44B64F-C3D4-4774-9952-97A7156C2BEB} +.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x02440000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class private auto ansi sealed beforefieldinit '<>f__AnonymousType0`2'<'j__TPar','j__TPar'> + extends [mscorlib]System.Object +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname instance !'j__TPar' + get_x() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: ret + } // end of method '<>f__AnonymousType0`2'::get_x + + .method public hidebysig specialname instance !'j__TPar' + get_l() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: ret + } // end of method '<>f__AnonymousType0`2'::get_l + + .method public hidebysig specialname rtspecialname + instance void .ctor(!'j__TPar' x, + !'j__TPar' l) cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0014: ret + } // end of method '<>f__AnonymousType0`2'::.ctor + + .method public hidebysig virtual instance bool + Equals(object 'value') cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 59 (0x3b) + .maxstack 3 + .locals init (class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> V_0) + IL_0000: ldarg.1 + IL_0001: isinst class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_0039 + + IL_000a: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_000f: ldarg.0 + IL_0010: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0015: ldloc.0 + IL_0016: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_001b: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0020: brfalse.s IL_0039 + + IL_0022: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0027: ldarg.0 + IL_0028: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_002d: ldloc.0 + IL_002e: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0033: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0038: ret + + IL_0039: ldc.i4.0 + IL_003a: ret + } // end of method '<>f__AnonymousType0`2'::Equals + + .method public hidebysig virtual instance int32 + GetHashCode() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 52 (0x34) + .maxstack 8 + IL_0000: ldc.i4 0xf0268823 + IL_0005: ldc.i4 0xa5555529 + IL_000a: mul + IL_000b: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0010: ldarg.0 + IL_0011: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0016: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_001b: add + IL_001c: ldc.i4 0xa5555529 + IL_0021: mul + IL_0022: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0027: ldarg.0 + IL_0028: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_002d: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_0032: add + IL_0033: ret + } // end of method '<>f__AnonymousType0`2'::GetHashCode + + .method public hidebysig virtual instance string + ToString() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 136 (0x88) + .maxstack 7 + .locals init (!'j__TPar' V_0, + !'j__TPar' V_1, + !'j__TPar' V_2, + !'j__TPar' V_3) + IL_0000: ldnull + IL_0001: ldstr "{{ x = {0}, l = {1} }}" + IL_0006: ldc.i4.2 + IL_0007: newarr [mscorlib]System.Object + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldarg.0 + IL_000f: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0014: stloc.0 + IL_0015: ldloca.s V_0 + IL_0017: ldloca.s V_1 + IL_0019: initobj !'j__TPar' + IL_001f: ldloc.1 + IL_0020: box !'j__TPar' + IL_0025: brtrue.s IL_003b + + IL_0027: ldobj !'j__TPar' + IL_002c: stloc.1 + IL_002d: ldloca.s V_1 + IL_002f: ldloc.1 + IL_0030: box !'j__TPar' + IL_0035: brtrue.s IL_003b + + IL_0037: pop + IL_0038: ldnull + IL_0039: br.s IL_0046 + + IL_003b: constrained. !'j__TPar' + IL_0041: callvirt instance string [mscorlib]System.Object::ToString() + IL_0046: stelem.ref + IL_0047: dup + IL_0048: ldc.i4.1 + IL_0049: ldarg.0 + IL_004a: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_004f: stloc.2 + IL_0050: ldloca.s V_2 + IL_0052: ldloca.s V_3 + IL_0054: initobj !'j__TPar' + IL_005a: ldloc.3 + IL_005b: box !'j__TPar' + IL_0060: brtrue.s IL_0076 + + IL_0062: ldobj !'j__TPar' + IL_0067: stloc.3 + IL_0068: ldloca.s V_3 + IL_006a: ldloc.3 + IL_006b: box !'j__TPar' + IL_0070: brtrue.s IL_0076 + + IL_0072: pop + IL_0073: ldnull + IL_0074: br.s IL_0081 + + IL_0076: constrained. !'j__TPar' + IL_007c: callvirt instance string [mscorlib]System.Object::ToString() + IL_0081: stelem.ref + IL_0082: call string [mscorlib]System.String::Format(class [mscorlib]System.IFormatProvider, + string, + object[]) + IL_0087: ret + } // end of method '<>f__AnonymousType0`2'::ToString + + .property instance !'j__TPar' x() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_x() + } // end of property '<>f__AnonymousType0`2'::x + .property instance !'j__TPar' l() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_l() + } // end of property '<>f__AnonymousType0`2'::l +} // end of class '<>f__AnonymousType0`2' + +.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + extends [mscorlib]System.Object +{ + .class auto ansi serializable sealed nested private beforefieldinit '<>c' + extends [mscorlib]System.Object + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field public static initonly class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' '<>9' + .field public static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> '<>9__4_0' + .field public static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> '<>9__5_0' + .field public static class [mscorlib]System.Func`2 '<>9__6_0' + .method private hidebysig specialname rtspecialname static + void .cctor() cil managed + { + // Code size 11 (0xb) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::.ctor() + IL_0005: stsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_000a: ret + } // end of method '<>c'::.cctor + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } // end of method '<>c'::.ctor + + .method assembly hidebysig instance class '<>f__AnonymousType0`2' + 'b__4_0'(class '<>f__AnonymousType0`2' n) cil managed + { + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.1 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add.ovf + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: ret + } // end of method '<>c'::'b__4_0' + + .method assembly hidebysig instance class '<>f__AnonymousType0`2' + 'b__5_0'(class '<>f__AnonymousType0`2' n) cil managed + { + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.1 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: ret + } // end of method '<>c'::'b__5_0' + + .method assembly hidebysig instance int32[] + 'b__6_0'(int32[] n) cil managed + { + // Code size 23 (0x17) + .maxstack 8 + IL_0000: ldc.i4.2 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldarg.1 + IL_0009: ldc.i4.0 + IL_000a: ldelem.i4 + IL_000b: ldc.i4.1 + IL_000c: add.ovf + IL_000d: stelem.i4 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldarg.1 + IL_0011: ldc.i4.1 + IL_0012: ldelem.i4 + IL_0013: ldc.i4.1 + IL_0014: add.ovf + IL_0015: stelem.i4 + IL_0016: ret + } // end of method '<>c'::'b__6_0' + + } // end of class '<>c' + + .method public hidebysig instance int32 + Operators(int32 a, + int32 b) cil managed + { + // Code size 52 (0x34) + .maxstack 3 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32 V_3, + int32 V_4, + int32 V_5, + int32 V_6) + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf + IL_0003: ldarg.1 + IL_0004: ldarg.2 + IL_0005: add + IL_0006: stloc.0 + IL_0007: ldarg.1 + IL_0008: ldarg.2 + IL_0009: sub.ovf + IL_000a: stloc.1 + IL_000b: ldarg.1 + IL_000c: ldarg.2 + IL_000d: sub + IL_000e: stloc.2 + IL_000f: ldarg.1 + IL_0010: ldarg.2 + IL_0011: mul.ovf + IL_0012: stloc.3 + IL_0013: ldarg.1 + IL_0014: ldarg.2 + IL_0015: mul + IL_0016: stloc.s V_4 + IL_0018: ldarg.1 + IL_0019: ldarg.2 + IL_001a: div + IL_001b: stloc.s V_5 + IL_001d: ldarg.1 + IL_001e: ldarg.2 + IL_001f: rem + IL_0020: stloc.s V_6 + IL_0022: ldloc.0 + IL_0023: mul + IL_0024: ldloc.1 + IL_0025: mul + IL_0026: ldloc.2 + IL_0027: mul + IL_0028: ldloc.3 + IL_0029: mul + IL_002a: ldloc.s V_4 + IL_002c: mul + IL_002d: ldloc.s V_5 + IL_002f: mul + IL_0030: ldloc.s V_6 + IL_0032: mul + IL_0033: ret + } // end of method CheckedUnchecked::Operators + + .method public hidebysig instance int32 + Cast(int32 a) cil managed + { + // Code size 18 (0x12) + .maxstack 2 + .locals init (int16 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: conv.ovf.i2 + IL_0002: ldarg.1 + IL_0003: conv.i2 + IL_0004: stloc.0 + IL_0005: ldarg.1 + IL_0006: conv.ovf.u1 + IL_0007: stloc.1 + IL_0008: ldarg.1 + IL_0009: conv.u1 + IL_000a: stloc.2 + IL_000b: ldloc.0 + IL_000c: mul + IL_000d: ldloc.1 + IL_000e: mul + IL_000f: ldloc.2 + IL_0010: mul + IL_0011: ret + } // end of method CheckedUnchecked::Cast + + .method public hidebysig instance void + ForWithCheckedIteratorAndUncheckedBody(int32 n) cil managed + { + // Code size 22 (0x16) + .maxstack 3 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: ldc.i4.1 + IL_0002: add.ovf + IL_0003: stloc.0 + IL_0004: br.s IL_000f + + IL_0006: ldloc.0 + IL_0007: ldloc.0 + IL_0008: mul + IL_0009: starg.s n + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: add.ovf + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldarg.1 + IL_0011: ldc.i4.1 + IL_0012: add.ovf + IL_0013: blt.s IL_0006 + + IL_0015: ret + } // end of method CheckedUnchecked::ForWithCheckedIteratorAndUncheckedBody + + .method public hidebysig instance void + ForWithCheckedInitializerAndUncheckedIterator(int32 n) cil managed + { + // Code size 23 (0x17) + .maxstack 2 + .locals init (int32 V_0) + IL_0000: ldarg.1 + IL_0001: stloc.0 + IL_0002: ldloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: sub.ovf + IL_0006: stloc.0 + IL_0007: br.s IL_0012 + + IL_0009: ldarg.1 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: starg.s n + IL_000e: ldloc.0 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: ldarg.1 + IL_0014: blt.s IL_0009 + + IL_0016: ret + } // end of method CheckedUnchecked::ForWithCheckedInitializerAndUncheckedIterator + + .method public hidebysig instance void + ObjectCreationInitializerChecked() cil managed + { + // Code size 46 (0x2e) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.0 + IL_0003: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0008: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__4_0' + IL_000d: dup + IL_000e: brtrue.s IL_0027 + + IL_0010: pop + IL_0011: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_0016: ldftn instance class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'b__4_0'(class '<>f__AnonymousType0`2') + IL_001c: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_0021: dup + IL_0022: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__4_0' + IL_0027: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002c: pop + IL_002d: ret + } // end of method CheckedUnchecked::ObjectCreationInitializerChecked + + .method public hidebysig instance void + ObjectCreationWithOneFieldChecked() cil managed + { + // Code size 46 (0x2e) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.0 + IL_0003: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0008: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__5_0' + IL_000d: dup + IL_000e: brtrue.s IL_0027 + + IL_0010: pop + IL_0011: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_0016: ldftn instance class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'b__5_0'(class '<>f__AnonymousType0`2') + IL_001c: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_0021: dup + IL_0022: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__5_0' + IL_0027: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002c: pop + IL_002d: ret + } // end of method CheckedUnchecked::ObjectCreationWithOneFieldChecked + + .method public hidebysig instance void + ArrayInitializerChecked() cil managed + { + // Code size 53 (0x35) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldc.i4.2 + IL_0002: newarr [mscorlib]System.Int32 + IL_0007: dup + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.1 + IL_000a: stelem.i4 + IL_000b: dup + IL_000c: ldc.i4.1 + IL_000d: ldc.i4.2 + IL_000e: stelem.i4 + IL_000f: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__6_0' + IL_0014: dup + IL_0015: brtrue.s IL_002e + + IL_0017: pop + IL_0018: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_001d: ldftn instance int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'b__6_0'(int32[]) + IL_0023: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0028: dup + IL_0029: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__6_0' + IL_002e: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelp(!!0, + class [mscorlib]System.Func`2) + IL_0033: pop + IL_0034: ret + } // end of method CheckedUnchecked::ArrayInitializerChecked + + .method public hidebysig instance !!T TestHelp(!!T t, + class [mscorlib]System.Func`2 f) cil managed + { + // Code size 8 (0x8) + .maxstack 8 + IL_0000: ldarg.2 + IL_0001: ldarg.1 + IL_0002: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_0007: ret + } // end of method CheckedUnchecked::TestHelp + + .method public hidebysig instance void + CheckedInArrayCreationArgument(int32 a, + int32 b) cil managed + { + // Code size 14 (0xe) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf + IL_0003: newarr [mscorlib]System.Int32 + IL_0008: call void [mscorlib]System.Console::WriteLine(object) + IL_000d: ret + } // end of method CheckedUnchecked::CheckedInArrayCreationArgument + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ret + } // end of method CheckedUnchecked::.ctor + +} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** diff --git a/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il new file mode 100644 index 000000000..b64d624b7 --- /dev/null +++ b/ICSharpCode.Decompiler.Tests/TestCases/Pretty/CheckedUnchecked.roslyn.il @@ -0,0 +1,647 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.18020 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// Metadata version: v4.0.30319 +.assembly extern mscorlib +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. + .ver 4:0:0:0 +} +.assembly CheckedUnchecked +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx + 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. + + // --- The following custom attribute is added automatically, do not uncomment ------- + // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 07 01 00 00 00 00 ) + + .permissionset reqmin + = {[mscorlib]System.Security.Permissions.SecurityPermissionAttribute = {property bool 'SkipVerification' = bool(true)}} + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module CheckedUnchecked.dll +// MVID: {99C747B4-9547-452B-8101-128D75599E60} +.custom instance void [mscorlib]System.Security.UnverifiableCodeAttribute::.ctor() = ( 01 00 00 00 ) +.imagebase 0x10000000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x02FB0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class private auto ansi sealed beforefieldinit '<>f__AnonymousType0`2'<'j__TPar','j__TPar'> + extends [mscorlib]System.Object +{ + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerDisplayAttribute::.ctor(string) = ( 01 00 15 5C 7B 20 78 20 3D 20 7B 78 7D 2C 20 6C // ...\{ x = {x}, l + 20 3D 20 7B 6C 7D 20 7D 01 00 54 0E 04 54 79 70 // = {l} }..T..Typ + 65 10 3C 41 6E 6F 6E 79 6D 6F 75 73 20 54 79 70 // e. + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .field private initonly !'j__TPar' 'i__Field' + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public hidebysig specialname instance !'j__TPar' + get_x() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: ret + } // end of method '<>f__AnonymousType0`2'::get_x + + .method public hidebysig specialname instance !'j__TPar' + get_l() cil managed + { + // Code size 7 (0x7) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0006: ret + } // end of method '<>f__AnonymousType0`2'::get_l + + .method public hidebysig specialname rtspecialname + instance void .ctor(!'j__TPar' x, + !'j__TPar' l) cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 21 (0x15) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: stfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_000d: ldarg.0 + IL_000e: ldarg.2 + IL_000f: stfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0014: ret + } // end of method '<>f__AnonymousType0`2'::.ctor + + .method public hidebysig virtual instance bool + Equals(object 'value') cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 60 (0x3c) + .maxstack 3 + .locals init (class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> V_0) + IL_0000: ldarg.1 + IL_0001: isinst class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'> + IL_0006: stloc.0 + IL_0007: ldloc.0 + IL_0008: brfalse.s IL_003a + + IL_000a: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_000f: ldarg.0 + IL_0010: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0015: ldloc.0 + IL_0016: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_001b: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0020: brfalse.s IL_003a + + IL_0022: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0027: ldarg.0 + IL_0028: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_002d: ldloc.0 + IL_002e: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0033: callvirt instance bool class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::Equals(!0, + !0) + IL_0038: br.s IL_003b + + IL_003a: ldc.i4.0 + IL_003b: ret + } // end of method '<>f__AnonymousType0`2'::Equals + + .method public hidebysig virtual instance int32 + GetHashCode() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 52 (0x34) + .maxstack 8 + IL_0000: ldc.i4 0xf0268823 + IL_0005: ldc.i4 0xa5555529 + IL_000a: mul + IL_000b: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0010: ldarg.0 + IL_0011: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0016: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_001b: add + IL_001c: ldc.i4 0xa5555529 + IL_0021: mul + IL_0022: call class [mscorlib]System.Collections.Generic.EqualityComparer`1 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::get_Default() + IL_0027: ldarg.0 + IL_0028: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_002d: callvirt instance int32 class [mscorlib]System.Collections.Generic.EqualityComparer`1j__TPar'>::GetHashCode(!0) + IL_0032: add + IL_0033: ret + } // end of method '<>f__AnonymousType0`2'::GetHashCode + + .method public hidebysig virtual instance string + ToString() cil managed + { + .custom instance void [mscorlib]System.Diagnostics.DebuggerHiddenAttribute::.ctor() = ( 01 00 00 00 ) + // Code size 136 (0x88) + .maxstack 7 + .locals init (!'j__TPar' V_0, + !'j__TPar' V_1, + !'j__TPar' V_2, + !'j__TPar' V_3) + IL_0000: ldnull + IL_0001: ldstr "{{ x = {0}, l = {1} }}" + IL_0006: ldc.i4.2 + IL_0007: newarr [mscorlib]System.Object + IL_000c: dup + IL_000d: ldc.i4.0 + IL_000e: ldarg.0 + IL_000f: ldfld !0 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_0014: stloc.0 + IL_0015: ldloca.s V_0 + IL_0017: ldloca.s V_1 + IL_0019: initobj !'j__TPar' + IL_001f: ldloc.1 + IL_0020: box !'j__TPar' + IL_0025: brtrue.s IL_003b + + IL_0027: ldobj !'j__TPar' + IL_002c: stloc.1 + IL_002d: ldloca.s V_1 + IL_002f: ldloc.1 + IL_0030: box !'j__TPar' + IL_0035: brtrue.s IL_003b + + IL_0037: pop + IL_0038: ldnull + IL_0039: br.s IL_0046 + + IL_003b: constrained. !'j__TPar' + IL_0041: callvirt instance string [mscorlib]System.Object::ToString() + IL_0046: stelem.ref + IL_0047: dup + IL_0048: ldc.i4.1 + IL_0049: ldarg.0 + IL_004a: ldfld !1 class '<>f__AnonymousType0`2'j__TPar',!'j__TPar'>::'i__Field' + IL_004f: stloc.2 + IL_0050: ldloca.s V_2 + IL_0052: ldloca.s V_3 + IL_0054: initobj !'j__TPar' + IL_005a: ldloc.3 + IL_005b: box !'j__TPar' + IL_0060: brtrue.s IL_0076 + + IL_0062: ldobj !'j__TPar' + IL_0067: stloc.3 + IL_0068: ldloca.s V_3 + IL_006a: ldloc.3 + IL_006b: box !'j__TPar' + IL_0070: brtrue.s IL_0076 + + IL_0072: pop + IL_0073: ldnull + IL_0074: br.s IL_0081 + + IL_0076: constrained. !'j__TPar' + IL_007c: callvirt instance string [mscorlib]System.Object::ToString() + IL_0081: stelem.ref + IL_0082: call string [mscorlib]System.String::Format(class [mscorlib]System.IFormatProvider, + string, + object[]) + IL_0087: ret + } // end of method '<>f__AnonymousType0`2'::ToString + + .property instance !'j__TPar' x() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_x() + } // end of property '<>f__AnonymousType0`2'::x + .property instance !'j__TPar' l() + { + .get instance !'j__TPar' '<>f__AnonymousType0`2'::get_l() + } // end of property '<>f__AnonymousType0`2'::l +} // end of class '<>f__AnonymousType0`2' + +.class public auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + extends [mscorlib]System.Object +{ + .class auto ansi serializable sealed nested private beforefieldinit '<>c' + extends [mscorlib]System.Object + { + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .field public static initonly class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' '<>9' + .field public static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> '<>9__4_0' + .field public static class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> '<>9__5_0' + .field public static class [mscorlib]System.Func`2 '<>9__6_0' + .method private hidebysig specialname rtspecialname static + void .cctor() cil managed + { + // Code size 11 (0xb) + .maxstack 8 + IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::.ctor() + IL_0005: stsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_000a: ret + } // end of method '<>c'::.cctor + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 8 (0x8) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: nop + IL_0007: ret + } // end of method '<>c'::.ctor + + .method assembly hidebysig instance class '<>f__AnonymousType0`2' + 'b__4_0'(class '<>f__AnonymousType0`2' n) cil managed + { + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.1 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add.ovf + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: ret + } // end of method '<>c'::'b__4_0' + + .method assembly hidebysig instance class '<>f__AnonymousType0`2' + 'b__5_0'(class '<>f__AnonymousType0`2' n) cil managed + { + // Code size 22 (0x16) + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: callvirt instance !0 class '<>f__AnonymousType0`2'::get_x() + IL_0006: ldc.i4.1 + IL_0007: add.ovf + IL_0008: ldarg.1 + IL_0009: callvirt instance !1 class '<>f__AnonymousType0`2'::get_l() + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0015: ret + } // end of method '<>c'::'b__5_0' + + .method assembly hidebysig instance int32[] + 'b__6_0'(int32[] n) cil managed + { + // Code size 23 (0x17) + .maxstack 8 + IL_0000: ldc.i4.2 + IL_0001: newarr [mscorlib]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldarg.1 + IL_0009: ldc.i4.0 + IL_000a: ldelem.i4 + IL_000b: ldc.i4.1 + IL_000c: add.ovf + IL_000d: stelem.i4 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldarg.1 + IL_0011: ldc.i4.1 + IL_0012: ldelem.i4 + IL_0013: ldc.i4.1 + IL_0014: add.ovf + IL_0015: stelem.i4 + IL_0016: ret + } // end of method '<>c'::'b__6_0' + + } // end of class '<>c' + + .method public hidebysig instance int32 + Operators(int32 a, + int32 b) cil managed + { + // Code size 63 (0x3f) + .maxstack 2 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + int32 V_3, + int32 V_4, + int32 V_5, + int32 V_6, + int32 V_7, + int32 V_8) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: add.ovf + IL_0004: stloc.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: add + IL_0008: stloc.1 + IL_0009: ldarg.1 + IL_000a: ldarg.2 + IL_000b: sub.ovf + IL_000c: stloc.2 + IL_000d: ldarg.1 + IL_000e: ldarg.2 + IL_000f: sub + IL_0010: stloc.3 + IL_0011: ldarg.1 + IL_0012: ldarg.2 + IL_0013: mul.ovf + IL_0014: stloc.s V_4 + IL_0016: ldarg.1 + IL_0017: ldarg.2 + IL_0018: mul + IL_0019: stloc.s V_5 + IL_001b: ldarg.1 + IL_001c: ldarg.2 + IL_001d: div + IL_001e: stloc.s V_6 + IL_0020: ldarg.1 + IL_0021: ldarg.2 + IL_0022: rem + IL_0023: stloc.s V_7 + IL_0025: ldloc.0 + IL_0026: ldloc.1 + IL_0027: mul + IL_0028: ldloc.2 + IL_0029: mul + IL_002a: ldloc.3 + IL_002b: mul + IL_002c: ldloc.s V_4 + IL_002e: mul + IL_002f: ldloc.s V_5 + IL_0031: mul + IL_0032: ldloc.s V_6 + IL_0034: mul + IL_0035: ldloc.s V_7 + IL_0037: mul + IL_0038: stloc.s V_8 + IL_003a: br.s IL_003c + + IL_003c: ldloc.s V_8 + IL_003e: ret + } // end of method CheckedUnchecked::Operators + + .method public hidebysig instance int32 + Cast(int32 a) cil managed + { + // Code size 27 (0x1b) + .maxstack 2 + .locals init (int16 V_0, + int16 V_1, + uint8 V_2, + uint8 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: conv.ovf.i2 + IL_0003: stloc.0 + IL_0004: ldarg.1 + IL_0005: conv.i2 + IL_0006: stloc.1 + IL_0007: ldarg.1 + IL_0008: conv.ovf.u1 + IL_0009: stloc.2 + IL_000a: ldarg.1 + IL_000b: conv.u1 + IL_000c: stloc.3 + IL_000d: ldloc.0 + IL_000e: ldloc.1 + IL_000f: mul + IL_0010: ldloc.2 + IL_0011: mul + IL_0012: ldloc.3 + IL_0013: mul + IL_0014: stloc.s V_4 + IL_0016: br.s IL_0018 + + IL_0018: ldloc.s V_4 + IL_001a: ret + } // end of method CheckedUnchecked::Cast + + .method public hidebysig instance void + ForWithCheckedIteratorAndUncheckedBody(int32 n) cil managed + { + // Code size 31 (0x1f) + .maxstack 3 + .locals init (int32 V_0, + bool V_1) + IL_0000: nop + IL_0001: nop + IL_0002: ldarg.1 + IL_0003: ldc.i4.1 + IL_0004: add.ovf + IL_0005: stloc.0 + IL_0006: br.s IL_0013 + + IL_0008: nop + IL_0009: ldloc.0 + IL_000a: ldloc.0 + IL_000b: mul + IL_000c: starg.s n + IL_000e: nop + IL_000f: ldloc.0 + IL_0010: ldc.i4.1 + IL_0011: add.ovf + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: ldarg.1 + IL_0015: ldc.i4.1 + IL_0016: add.ovf + IL_0017: clt + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: brtrue.s IL_0008 + + IL_001d: nop + IL_001e: ret + } // end of method CheckedUnchecked::ForWithCheckedIteratorAndUncheckedBody + + .method public hidebysig instance void + ForWithCheckedInitializerAndUncheckedIterator(int32 n) cil managed + { + // Code size 30 (0x1e) + .maxstack 2 + .locals init (int32 V_0, + bool V_1) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: stloc.0 + IL_0003: ldloc.0 + IL_0004: ldc.i4.s 10 + IL_0006: sub.ovf + IL_0007: stloc.0 + IL_0008: br.s IL_0015 + + IL_000a: nop + IL_000b: ldarg.1 + IL_000c: ldc.i4.1 + IL_000d: sub + IL_000e: starg.s n + IL_0010: nop + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldarg.1 + IL_0017: clt + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: brtrue.s IL_000a + + IL_001d: ret + } // end of method CheckedUnchecked::ForWithCheckedInitializerAndUncheckedIterator + + .method public hidebysig instance void + ObjectCreationInitializerChecked() cil managed + { + // Code size 47 (0x2f) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.0 + IL_0003: ldc.i4.0 + IL_0004: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0009: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__4_0' + IL_000e: dup + IL_000f: brtrue.s IL_0028 + + IL_0011: pop + IL_0012: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_0017: ldftn instance class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'b__4_0'(class '<>f__AnonymousType0`2') + IL_001d: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_0022: dup + IL_0023: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__4_0' + IL_0028: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002d: pop + IL_002e: ret + } // end of method CheckedUnchecked::ObjectCreationInitializerChecked + + .method public hidebysig instance void + ObjectCreationWithOneFieldChecked() cil managed + { + // Code size 47 (0x2f) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.0 + IL_0003: ldc.i4.0 + IL_0004: newobj instance void class '<>f__AnonymousType0`2'::.ctor(!0, + !1) + IL_0009: ldsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__5_0' + IL_000e: dup + IL_000f: brtrue.s IL_0028 + + IL_0011: pop + IL_0012: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_0017: ldftn instance class '<>f__AnonymousType0`2' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'b__5_0'(class '<>f__AnonymousType0`2') + IL_001d: newobj instance void class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'>::.ctor(object, + native int) + IL_0022: dup + IL_0023: stsfld class [mscorlib]System.Func`2f__AnonymousType0`2',class '<>f__AnonymousType0`2'> ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__5_0' + IL_0028: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelpf__AnonymousType0`2'>(!!0, + class [mscorlib]System.Func`2) + IL_002d: pop + IL_002e: ret + } // end of method CheckedUnchecked::ObjectCreationWithOneFieldChecked + + .method public hidebysig instance void + ArrayInitializerChecked() cil managed + { + // Code size 54 (0x36) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.2 + IL_0003: newarr [mscorlib]System.Int32 + IL_0008: dup + IL_0009: ldc.i4.0 + IL_000a: ldc.i4.1 + IL_000b: stelem.i4 + IL_000c: dup + IL_000d: ldc.i4.1 + IL_000e: ldc.i4.2 + IL_000f: stelem.i4 + IL_0010: ldsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__6_0' + IL_0015: dup + IL_0016: brtrue.s IL_002f + + IL_0018: pop + IL_0019: ldsfld class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c' ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9' + IL_001e: ldftn instance int32[] ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'b__6_0'(int32[]) + IL_0024: newobj instance void class [mscorlib]System.Func`2::.ctor(object, + native int) + IL_0029: dup + IL_002a: stsfld class [mscorlib]System.Func`2 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked/'<>c'::'<>9__6_0' + IL_002f: call instance !!0 ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked::TestHelp(!!0, + class [mscorlib]System.Func`2) + IL_0034: pop + IL_0035: ret + } // end of method CheckedUnchecked::ArrayInitializerChecked + + .method public hidebysig instance !!T TestHelp(!!T t, + class [mscorlib]System.Func`2 f) cil managed + { + // Code size 13 (0xd) + .maxstack 2 + .locals init (!!T V_0) + IL_0000: nop + IL_0001: ldarg.2 + IL_0002: ldarg.1 + IL_0003: callvirt instance !1 class [mscorlib]System.Func`2::Invoke(!0) + IL_0008: stloc.0 + IL_0009: br.s IL_000b + + IL_000b: ldloc.0 + IL_000c: ret + } // end of method CheckedUnchecked::TestHelp + + .method public hidebysig instance void + CheckedInArrayCreationArgument(int32 a, + int32 b) cil managed + { + // Code size 16 (0x10) + .maxstack 8 + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.2 + IL_0003: add.ovf + IL_0004: newarr [mscorlib]System.Int32 + IL_0009: call void [mscorlib]System.Console::WriteLine(object) + IL_000e: nop + IL_000f: ret + } // end of method CheckedUnchecked::CheckedInArrayCreationArgument + + .method public hidebysig specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 8 (0x8) + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void [mscorlib]System.Object::.ctor() + IL_0006: nop + IL_0007: ret + } // end of method CheckedUnchecked::.ctor + +} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.CheckedUnchecked + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE ***********************