mirror of https://github.com/icsharpcode/ILSpy.git
296 changed files with 8562 additions and 3052 deletions
@ -1,4 +1,3 @@
@@ -1,4 +1,3 @@
|
||||
[submodule "ILSpy-tests"] |
||||
path = ILSpy-tests |
||||
url = https://github.com/icsharpcode/ILSpy-tests |
||||
|
After Width: | Height: | Size: 2.4 KiB |
@ -0,0 +1,117 @@
@@ -0,0 +1,117 @@
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness |
||||
{ |
||||
class StringConcat |
||||
{ |
||||
private class C |
||||
{ |
||||
int i; |
||||
|
||||
public C(int i) |
||||
{ |
||||
Console.WriteLine(" new C(" + i + ")"); |
||||
this.i = i; |
||||
} |
||||
|
||||
public override string ToString() |
||||
{ |
||||
Console.WriteLine(" C(" + i + ").ToString()"); |
||||
return (i++).ToString(); |
||||
} |
||||
} |
||||
|
||||
private struct S |
||||
{ |
||||
int i; |
||||
|
||||
public S(int i) |
||||
{ |
||||
Console.WriteLine(" new C(" + i + ")"); |
||||
this.i = i; |
||||
} |
||||
|
||||
public override string ToString() |
||||
{ |
||||
Console.WriteLine(" S(" + i + ").ToString()"); |
||||
return (i++).ToString(); |
||||
} |
||||
} |
||||
|
||||
static string Space() |
||||
{ |
||||
Console.WriteLine(" Space()"); |
||||
return " "; |
||||
} |
||||
|
||||
static void TestClass() |
||||
{ |
||||
Console.WriteLine("string + C:"); |
||||
Console.WriteLine(Space() + new C(1)); |
||||
|
||||
Console.WriteLine("C + string:"); |
||||
Console.WriteLine(new C(2) + Space()); |
||||
|
||||
Console.WriteLine("C + string + C:"); |
||||
Console.WriteLine(new C(3) + Space() + new C(4)); |
||||
|
||||
Console.WriteLine("string + C + C:"); |
||||
Console.WriteLine(Space() + new C(5) + new C(6)); |
||||
|
||||
Console.WriteLine("string.Concat(C, string, C):"); |
||||
Console.WriteLine(string.Concat(new C(10), Space(), new C(11))); |
||||
|
||||
Console.WriteLine("string.Concat(string.Concat(C, string), C):"); |
||||
Console.WriteLine(string.Concat(string.Concat(new C(15), Space()), new C(16))); |
||||
|
||||
Console.WriteLine("string.Concat(C, string.Concat(string, C)):"); |
||||
Console.WriteLine(string.Concat(new C(20), string.Concat(Space(), new C(21)))); |
||||
|
||||
Console.WriteLine("string.Concat(C, string) + C:"); |
||||
Console.WriteLine(string.Concat(new C(30), Space()) + new C(31)); |
||||
} |
||||
|
||||
static void TestStruct() |
||||
{ |
||||
Console.WriteLine("string + S:"); |
||||
Console.WriteLine(Space() + new S(1)); |
||||
|
||||
Console.WriteLine("S + string:"); |
||||
Console.WriteLine(new S(2) + Space()); |
||||
|
||||
Console.WriteLine("S + string + S:"); |
||||
Console.WriteLine(new S(3) + Space() + new S(4)); |
||||
|
||||
Console.WriteLine("string + S + S:"); |
||||
Console.WriteLine(Space() + new S(5) + new S(6)); |
||||
|
||||
Console.WriteLine("string.Concat(S, string, S):"); |
||||
Console.WriteLine(string.Concat(new S(10), Space(), new S(11))); |
||||
|
||||
Console.WriteLine("string.Concat(string.Concat(S, string), S):"); |
||||
Console.WriteLine(string.Concat(string.Concat(new S(15), Space()), new S(16))); |
||||
|
||||
Console.WriteLine("string.Concat(S, string.Concat(string, S)):"); |
||||
Console.WriteLine(string.Concat(new S(20), string.Concat(Space(), new S(21)))); |
||||
|
||||
Console.WriteLine("string.Concat(S, string) + S:"); |
||||
Console.WriteLine(string.Concat(new S(30), Space()) + new S(31)); |
||||
} |
||||
|
||||
static void TestStructMutation() |
||||
{ |
||||
Console.WriteLine("TestStructMutation:"); |
||||
S s = new S(0); |
||||
Console.WriteLine(Space() + s); |
||||
Console.WriteLine(Space() + s.ToString()); |
||||
Console.WriteLine(s); |
||||
} |
||||
|
||||
static void Main() |
||||
{ |
||||
TestClass(); |
||||
TestStruct(); |
||||
TestStructMutation(); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,19 @@
@@ -0,0 +1,19 @@
|
||||
using System; |
||||
|
||||
namespace TestEnum |
||||
{ |
||||
public enum BooleanEnum : bool |
||||
{ |
||||
Min = false, |
||||
Zero = false, |
||||
One = true, |
||||
Max = byte.MaxValue |
||||
} |
||||
|
||||
public enum NativeIntEnum : IntPtr |
||||
{ |
||||
Zero = 0L, |
||||
One = 1L, |
||||
FortyTwo = 42L |
||||
} |
||||
} |
@ -0,0 +1,36 @@
@@ -0,0 +1,36 @@
|
||||
// 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 BoolEnum |
||||
{ |
||||
.ver 1:0:0:0 |
||||
} |
||||
.module BoolEnum.exe |
||||
.imagebase 0x00400000 |
||||
.file alignment 0x00000200 |
||||
.stackreserve 0x00100000 |
||||
.subsystem 0x0003 // WINDOWS_CUI |
||||
.corflags 0x00020003 // ILONLY 32BITPREFERRED |
||||
// Image base: 0x000001C4B6C90000 |
||||
|
||||
.class public auto ansi sealed TestEnum.BooleanEnum |
||||
extends [mscorlib]System.Enum |
||||
{ |
||||
.field public specialname rtspecialname bool value__ |
||||
.field public static literal valuetype TestEnum.BooleanEnum Min = bool(false) |
||||
.field public static literal valuetype TestEnum.BooleanEnum Zero = bool(false) |
||||
.field public static literal valuetype TestEnum.BooleanEnum One = bool(true) |
||||
.field public static literal valuetype TestEnum.BooleanEnum Max = uint8(255) |
||||
} |
||||
|
||||
.class public auto ansi sealed TestEnum.NativeIntEnum |
||||
extends [mscorlib]System.Enum |
||||
{ |
||||
.field public specialname rtspecialname native int value__ |
||||
.field public static literal valuetype TestEnum.NativeIntEnum Zero = int64(0) |
||||
.field public static literal valuetype TestEnum.NativeIntEnum One = int64(1) |
||||
.field public static literal valuetype TestEnum.NativeIntEnum FortyTwo = int64(42) |
||||
} |
@ -0,0 +1,65 @@
@@ -0,0 +1,65 @@
|
||||
using System; |
||||
using System.Collections.Generic; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
||||
{ |
||||
public class AsyncStreams |
||||
{ |
||||
public static async IAsyncEnumerable<int> CountTo(int until) |
||||
{ |
||||
for (int i = 0; i < until; i++) { |
||||
yield return i; |
||||
await Task.Delay(10); |
||||
} |
||||
} |
||||
|
||||
public static async IAsyncEnumerable<int> AlwaysThrow() |
||||
{ |
||||
throw null; |
||||
yield break; |
||||
} |
||||
|
||||
public static async IAsyncEnumerator<int> InfiniteLoop() |
||||
{ |
||||
while (true) { |
||||
} |
||||
yield break; |
||||
} |
||||
|
||||
public static async IAsyncEnumerable<int> InfiniteLoopWithAwait() |
||||
{ |
||||
while (true) { |
||||
await Task.Delay(10); |
||||
} |
||||
yield break; |
||||
} |
||||
|
||||
public async IAsyncEnumerable<int> AwaitInFinally() |
||||
{ |
||||
try { |
||||
Console.WriteLine("try"); |
||||
yield return 1; |
||||
Console.WriteLine("end try"); |
||||
} finally { |
||||
Console.WriteLine("finally"); |
||||
await Task.Yield(); |
||||
Console.WriteLine("end finally"); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public struct TestStruct |
||||
{ |
||||
private int i; |
||||
|
||||
public async IAsyncEnumerable<int> AwaitInStruct(TestStruct xx) |
||||
{ |
||||
xx.i++; |
||||
i++; |
||||
await Task.Yield(); |
||||
yield return i; |
||||
yield return xx.i; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,60 @@
@@ -0,0 +1,60 @@
|
||||
using System; |
||||
using System.Runtime.InteropServices; |
||||
using System.Threading.Tasks; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty |
||||
{ |
||||
internal class AsyncUsing |
||||
{ |
||||
internal class AsyncDisposableClass : IAsyncDisposable |
||||
{ |
||||
public ValueTask DisposeAsync() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
[StructLayout(LayoutKind.Sequential, Size = 1)] |
||||
internal struct AsyncDisposableStruct : IAsyncDisposable |
||||
{ |
||||
public ValueTask DisposeAsync() |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
} |
||||
|
||||
public static async void TestAsyncUsing(IAsyncDisposable disposable) |
||||
{ |
||||
await using (disposable) { |
||||
Console.WriteLine("Hello"); |
||||
} |
||||
} |
||||
|
||||
public static async void TestAsyncUsingClass() |
||||
{ |
||||
await using (AsyncDisposableClass test = new AsyncDisposableClass()) { |
||||
Use(test); |
||||
} |
||||
} |
||||
|
||||
public static async void TestAsyncUsingStruct() |
||||
{ |
||||
await using (AsyncDisposableStruct asyncDisposableStruct = default(AsyncDisposableStruct)) { |
||||
Use(asyncDisposableStruct); |
||||
} |
||||
} |
||||
|
||||
public static async void TestAsyncUsingNullableStruct() |
||||
{ |
||||
await using (AsyncDisposableStruct? asyncDisposableStruct = new AsyncDisposableStruct?(default(AsyncDisposableStruct))) { |
||||
Use(asyncDisposableStruct); |
||||
} |
||||
} |
||||
|
||||
private static void Use(IAsyncDisposable test) |
||||
{ |
||||
throw new NotImplementedException(); |
||||
} |
||||
|
||||
} |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,33 @@
@@ -0,0 +1,33 @@
|
||||
using System; |
||||
using System.Runtime.CompilerServices; |
||||
|
||||
[assembly: Extension] |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly |
||||
{ |
||||
[Extension] |
||||
internal static class NoExtensionMethods |
||||
{ |
||||
[Extension] |
||||
internal static Func<T> AsFunc<T>(T value) where T : class |
||||
{ |
||||
return new Func<T>(value, __ldftn(Return)); |
||||
} |
||||
|
||||
[Extension] |
||||
private static T Return<T>(T value) |
||||
{ |
||||
return value; |
||||
} |
||||
|
||||
internal static Func<int, int> ExtensionMethodAsStaticFunc() |
||||
{ |
||||
return Return; |
||||
} |
||||
|
||||
internal static Func<object> ExtensionMethodBoundToNull() |
||||
{ |
||||
return new Func<object>(null, __ldftn(Return)); |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,27 @@
@@ -0,0 +1,27 @@
|
||||
using System; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly |
||||
{ |
||||
internal static class NoExtensionMethods |
||||
{ |
||||
internal static Func<T> AsFunc<T>(this T value) where T : class |
||||
{ |
||||
return new Func<T>(value.Return); |
||||
} |
||||
|
||||
private static T Return<T>(this T value) |
||||
{ |
||||
return value; |
||||
} |
||||
|
||||
internal static Func<int, int> ExtensionMethodAsStaticFunc() |
||||
{ |
||||
return Return; |
||||
} |
||||
|
||||
internal static Func<object> ExtensionMethodBoundToNull() |
||||
{ |
||||
return ((object)null).Return; |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,93 @@
@@ -0,0 +1,93 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 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 NoExtensionMethods |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
.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 NoExtensionMethods.dll |
||||
.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 |
||||
|
||||
|
||||
// =============== CLASS MEMBERS DECLARATION =================== |
||||
|
||||
.class private abstract auto ansi sealed beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
.method assembly hidebysig static class [mscorlib]System.Func`1<!!T> |
||||
AsFunc<class T>(!!T 'value') cil managed |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
// Code size 18 (0x12) |
||||
.maxstack 8 |
||||
IL_0000: ldarg.0 |
||||
IL_0001: box !!T |
||||
IL_0006: ldftn !!0 ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods::Return<!!0>(!!0) |
||||
IL_000c: newobj instance void class [mscorlib]System.Func`1<!!T>::.ctor(object, |
||||
native int) |
||||
IL_0011: ret |
||||
} // end of method NoExtensionMethods::AsFunc |
||||
|
||||
.method private hidebysig static !!T Return<T>(!!T 'value') cil managed |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
// Code size 2 (0x2) |
||||
.maxstack 8 |
||||
IL_0000: ldarg.0 |
||||
IL_0001: ret |
||||
} // end of method NoExtensionMethods::Return |
||||
|
||||
.method assembly hidebysig static class [mscorlib]System.Func`2<int32,int32> |
||||
ExtensionMethodAsStaticFunc() cil managed |
||||
{ |
||||
// Code size 13 (0xd) |
||||
.maxstack 8 |
||||
IL_0000: ldnull |
||||
IL_0001: ldftn !!0 ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods::Return<int32>(!!0) |
||||
IL_0007: newobj instance void class [mscorlib]System.Func`2<int32,int32>::.ctor(object, |
||||
native int) |
||||
IL_000c: ret |
||||
} // end of method NoExtensionMethods::ExtensionMethodAsStaticFunc |
||||
|
||||
.method assembly hidebysig static class [mscorlib]System.Func`1<object> |
||||
ExtensionMethodBoundToNull() cil managed |
||||
{ |
||||
// Code size 13 (0xd) |
||||
.maxstack 8 |
||||
IL_0000: ldnull |
||||
IL_0001: ldftn !!0 ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods::Return<object>(!!0) |
||||
IL_0007: newobj instance void class [mscorlib]System.Func`1<object>::.ctor(object, |
||||
native int) |
||||
IL_000c: ret |
||||
} // end of method NoExtensionMethods::ExtensionMethodBoundToNull |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods |
||||
|
||||
|
||||
// ============================================================= |
||||
|
||||
// *********** DISASSEMBLY COMPLETE *********************** |
@ -0,0 +1,117 @@
@@ -0,0 +1,117 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 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 NoExtensionMethods |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
.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 NoExtensionMethods.dll |
||||
.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 |
||||
|
||||
|
||||
// =============== CLASS MEMBERS DECLARATION =================== |
||||
|
||||
.class private abstract auto ansi sealed beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
.method assembly hidebysig static class [mscorlib]System.Func`1<!!T> |
||||
AsFunc<class T>(!!T 'value') cil managed |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
// Code size 23 (0x17) |
||||
.maxstack 2 |
||||
.locals init (class [mscorlib]System.Func`1<!!T> V_0) |
||||
IL_0000: nop |
||||
IL_0001: ldarg.0 |
||||
IL_0002: box !!T |
||||
IL_0007: ldftn !!0 ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods::Return<!!0>(!!0) |
||||
IL_000d: newobj instance void class [mscorlib]System.Func`1<!!T>::.ctor(object, |
||||
native int) |
||||
IL_0012: stloc.0 |
||||
IL_0013: br.s IL_0015 |
||||
|
||||
IL_0015: ldloc.0 |
||||
IL_0016: ret |
||||
} // end of method NoExtensionMethods::AsFunc |
||||
|
||||
.method private hidebysig static !!T Return<T>(!!T 'value') cil managed |
||||
{ |
||||
.custom instance void [mscorlib]System.Runtime.CompilerServices.ExtensionAttribute::.ctor() = ( 01 00 00 00 ) |
||||
// Code size 7 (0x7) |
||||
.maxstack 1 |
||||
.locals init (!!T V_0) |
||||
IL_0000: nop |
||||
IL_0001: ldarg.0 |
||||
IL_0002: stloc.0 |
||||
IL_0003: br.s IL_0005 |
||||
|
||||
IL_0005: ldloc.0 |
||||
IL_0006: ret |
||||
} // end of method NoExtensionMethods::Return |
||||
|
||||
.method assembly hidebysig static class [mscorlib]System.Func`2<int32,int32> |
||||
ExtensionMethodAsStaticFunc() cil managed |
||||
{ |
||||
// Code size 18 (0x12) |
||||
.maxstack 2 |
||||
.locals init (class [mscorlib]System.Func`2<int32,int32> V_0) |
||||
IL_0000: nop |
||||
IL_0001: ldnull |
||||
IL_0002: ldftn !!0 ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods::Return<int32>(!!0) |
||||
IL_0008: newobj instance void class [mscorlib]System.Func`2<int32,int32>::.ctor(object, |
||||
native int) |
||||
IL_000d: stloc.0 |
||||
IL_000e: br.s IL_0010 |
||||
|
||||
IL_0010: ldloc.0 |
||||
IL_0011: ret |
||||
} // end of method NoExtensionMethods::ExtensionMethodAsStaticFunc |
||||
|
||||
.method assembly hidebysig static class [mscorlib]System.Func`1<object> |
||||
ExtensionMethodBoundToNull() cil managed |
||||
{ |
||||
// Code size 18 (0x12) |
||||
.maxstack 2 |
||||
.locals init (class [mscorlib]System.Func`1<object> V_0) |
||||
IL_0000: nop |
||||
IL_0001: ldnull |
||||
IL_0002: ldftn !!0 ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods::Return<object>(!!0) |
||||
IL_0008: newobj instance void class [mscorlib]System.Func`1<object>::.ctor(object, |
||||
native int) |
||||
IL_000d: stloc.0 |
||||
IL_000e: br.s IL_0010 |
||||
|
||||
IL_0010: ldloc.0 |
||||
IL_0011: ret |
||||
} // end of method NoExtensionMethods::ExtensionMethodBoundToNull |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoExtensionMethods |
||||
|
||||
|
||||
// ============================================================= |
||||
|
||||
// *********** DISASSEMBLY COMPLETE *********************** |
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly |
||||
{ |
||||
internal class NoForEachStatement |
||||
{ |
||||
public static void SimpleNonGenericForeach(IEnumerable enumerable) |
||||
{ |
||||
IEnumerator enumerator = enumerable.GetEnumerator(); |
||||
try { |
||||
while (enumerator.MoveNext()) { |
||||
#if ROSLYN && OPT
|
||||
Console.WriteLine(enumerator.Current); |
||||
#else
|
||||
object current = enumerator.Current; |
||||
Console.WriteLine(current); |
||||
#endif
|
||||
} |
||||
} finally { |
||||
IDisposable disposable = enumerator as IDisposable; |
||||
if (disposable != null) { |
||||
disposable.Dispose(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
public static void SimpleForeachOverInts(IEnumerable<int> enumerable) |
||||
{ |
||||
using (IEnumerator<int> enumerator = enumerable.GetEnumerator()) { |
||||
while (enumerator.MoveNext()) { |
||||
#if ROSLYN && OPT
|
||||
Console.WriteLine(enumerator.Current); |
||||
#else
|
||||
int current = enumerator.Current; |
||||
Console.WriteLine(current); |
||||
#endif
|
||||
} |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
using System; |
||||
using System.Collections; |
||||
using System.Collections.Generic; |
||||
|
||||
namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly |
||||
{ |
||||
internal class NoForEachStatement |
||||
{ |
||||
public static void SimpleNonGenericForeach(IEnumerable enumerable) |
||||
{ |
||||
foreach (object item in enumerable) { |
||||
Console.WriteLine(item); |
||||
} |
||||
} |
||||
|
||||
public static void SimpleForeachOverInts(IEnumerable<int> enumerable) |
||||
{ |
||||
foreach (int item in enumerable) { |
||||
Console.WriteLine(item); |
||||
} |
||||
} |
||||
} |
||||
} |
@ -0,0 +1,156 @@
@@ -0,0 +1,156 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 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 rerff2f0 |
||||
{ |
||||
.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 rerff2f0.dll |
||||
.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 |
||||
|
||||
|
||||
// =============== CLASS MEMBERS DECLARATION =================== |
||||
|
||||
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
.method public hidebysig static void SimpleNonGenericForeach(class [mscorlib]System.Collections.IEnumerable enumerable) cil managed |
||||
{ |
||||
// Code size 64 (0x40) |
||||
.maxstack 2 |
||||
.locals init (object V_0, |
||||
class [mscorlib]System.Collections.IEnumerator V_1, |
||||
bool V_2, |
||||
class [mscorlib]System.IDisposable V_3) |
||||
IL_0000: nop |
||||
IL_0001: nop |
||||
IL_0002: ldarg.0 |
||||
IL_0003: callvirt instance class [mscorlib]System.Collections.IEnumerator [mscorlib]System.Collections.IEnumerable::GetEnumerator() |
||||
IL_0008: stloc.1 |
||||
.try |
||||
{ |
||||
IL_0009: br.s IL_001b |
||||
|
||||
IL_000b: ldloc.1 |
||||
IL_000c: callvirt instance object [mscorlib]System.Collections.IEnumerator::get_Current() |
||||
IL_0011: stloc.0 |
||||
IL_0012: nop |
||||
IL_0013: ldloc.0 |
||||
IL_0014: call void [mscorlib]System.Console::WriteLine(object) |
||||
IL_0019: nop |
||||
IL_001a: nop |
||||
IL_001b: ldloc.1 |
||||
IL_001c: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_0021: stloc.2 |
||||
IL_0022: ldloc.2 |
||||
IL_0023: brtrue.s IL_000b |
||||
|
||||
IL_0025: leave.s IL_003e |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_0027: ldloc.1 |
||||
IL_0028: isinst [mscorlib]System.IDisposable |
||||
IL_002d: stloc.3 |
||||
IL_002e: ldloc.3 |
||||
IL_002f: ldnull |
||||
IL_0030: ceq |
||||
IL_0032: stloc.2 |
||||
IL_0033: ldloc.2 |
||||
IL_0034: brtrue.s IL_003d |
||||
|
||||
IL_0036: ldloc.3 |
||||
IL_0037: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_003c: nop |
||||
IL_003d: endfinally |
||||
} // end handler |
||||
IL_003e: nop |
||||
IL_003f: ret |
||||
} // end of method NoForEachStatement::SimpleNonGenericForeach |
||||
|
||||
.method public hidebysig static void SimpleForeachOverInts(class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> enumerable) cil managed |
||||
{ |
||||
// Code size 57 (0x39) |
||||
.maxstack 2 |
||||
.locals init (int32 V_0, |
||||
class [mscorlib]System.Collections.Generic.IEnumerator`1<int32> V_1, |
||||
bool V_2) |
||||
IL_0000: nop |
||||
IL_0001: nop |
||||
IL_0002: ldarg.0 |
||||
IL_0003: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<int32>::GetEnumerator() |
||||
IL_0008: stloc.1 |
||||
.try |
||||
{ |
||||
IL_0009: br.s IL_001b |
||||
|
||||
IL_000b: ldloc.1 |
||||
IL_000c: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<int32>::get_Current() |
||||
IL_0011: stloc.0 |
||||
IL_0012: nop |
||||
IL_0013: ldloc.0 |
||||
IL_0014: call void [mscorlib]System.Console::WriteLine(int32) |
||||
IL_0019: nop |
||||
IL_001a: nop |
||||
IL_001b: ldloc.1 |
||||
IL_001c: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_0021: stloc.2 |
||||
IL_0022: ldloc.2 |
||||
IL_0023: brtrue.s IL_000b |
||||
|
||||
IL_0025: leave.s IL_0037 |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_0027: ldloc.1 |
||||
IL_0028: ldnull |
||||
IL_0029: ceq |
||||
IL_002b: stloc.2 |
||||
IL_002c: ldloc.2 |
||||
IL_002d: brtrue.s IL_0036 |
||||
|
||||
IL_002f: ldloc.1 |
||||
IL_0030: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_0035: nop |
||||
IL_0036: endfinally |
||||
} // end handler |
||||
IL_0037: nop |
||||
IL_0038: ret |
||||
} // end of method NoForEachStatement::SimpleForeachOverInts |
||||
|
||||
.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 NoForEachStatement::.ctor |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
|
||||
|
||||
// ============================================================= |
||||
|
||||
// *********** DISASSEMBLY COMPLETE *********************** |
@ -0,0 +1,128 @@
@@ -0,0 +1,128 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 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 prqfqkbt |
||||
{ |
||||
.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 prqfqkbt.dll |
||||
.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 |
||||
|
||||
|
||||
// =============== CLASS MEMBERS DECLARATION =================== |
||||
|
||||
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
.method public hidebysig static void SimpleNonGenericForeach(class [mscorlib]System.Collections.IEnumerable enumerable) cil managed |
||||
{ |
||||
// Code size 50 (0x32) |
||||
.maxstack 1 |
||||
.locals init (object V_0, |
||||
class [mscorlib]System.Collections.IEnumerator V_1, |
||||
class [mscorlib]System.IDisposable V_2) |
||||
IL_0000: ldarg.0 |
||||
IL_0001: callvirt instance class [mscorlib]System.Collections.IEnumerator [mscorlib]System.Collections.IEnumerable::GetEnumerator() |
||||
IL_0006: stloc.1 |
||||
.try |
||||
{ |
||||
IL_0007: br.s IL_0016 |
||||
|
||||
IL_0009: ldloc.1 |
||||
IL_000a: callvirt instance object [mscorlib]System.Collections.IEnumerator::get_Current() |
||||
IL_000f: stloc.0 |
||||
IL_0010: ldloc.0 |
||||
IL_0011: call void [mscorlib]System.Console::WriteLine(object) |
||||
IL_0016: ldloc.1 |
||||
IL_0017: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_001c: brtrue.s IL_0009 |
||||
|
||||
IL_001e: leave.s IL_0031 |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_0020: ldloc.1 |
||||
IL_0021: isinst [mscorlib]System.IDisposable |
||||
IL_0026: stloc.2 |
||||
IL_0027: ldloc.2 |
||||
IL_0028: brfalse.s IL_0030 |
||||
|
||||
IL_002a: ldloc.2 |
||||
IL_002b: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_0030: endfinally |
||||
} // end handler |
||||
IL_0031: ret |
||||
} // end of method NoForEachStatement::SimpleNonGenericForeach |
||||
|
||||
.method public hidebysig static void SimpleForeachOverInts(class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> enumerable) cil managed |
||||
{ |
||||
// Code size 43 (0x2b) |
||||
.maxstack 1 |
||||
.locals init (int32 V_0, |
||||
class [mscorlib]System.Collections.Generic.IEnumerator`1<int32> V_1) |
||||
IL_0000: ldarg.0 |
||||
IL_0001: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<int32>::GetEnumerator() |
||||
IL_0006: stloc.1 |
||||
.try |
||||
{ |
||||
IL_0007: br.s IL_0016 |
||||
|
||||
IL_0009: ldloc.1 |
||||
IL_000a: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<int32>::get_Current() |
||||
IL_000f: stloc.0 |
||||
IL_0010: ldloc.0 |
||||
IL_0011: call void [mscorlib]System.Console::WriteLine(int32) |
||||
IL_0016: ldloc.1 |
||||
IL_0017: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_001c: brtrue.s IL_0009 |
||||
|
||||
IL_001e: leave.s IL_002a |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_0020: ldloc.1 |
||||
IL_0021: brfalse.s IL_0029 |
||||
|
||||
IL_0023: ldloc.1 |
||||
IL_0024: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_0029: endfinally |
||||
} // end handler |
||||
IL_002a: ret |
||||
} // end of method NoForEachStatement::SimpleForeachOverInts |
||||
|
||||
.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 NoForEachStatement::.ctor |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
|
||||
|
||||
// ============================================================= |
||||
|
||||
// *********** DISASSEMBLY COMPLETE *********************** |
@ -0,0 +1,126 @@
@@ -0,0 +1,126 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 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 NoForEachStatement |
||||
{ |
||||
.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 NoForEachStatement.dll |
||||
.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 |
||||
|
||||
|
||||
// =============== CLASS MEMBERS DECLARATION =================== |
||||
|
||||
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
.method public hidebysig static void SimpleNonGenericForeach(class [mscorlib]System.Collections.IEnumerable enumerable) cil managed |
||||
{ |
||||
// Code size 48 (0x30) |
||||
.maxstack 1 |
||||
.locals init (class [mscorlib]System.Collections.IEnumerator V_0, |
||||
class [mscorlib]System.IDisposable V_1) |
||||
IL_0000: ldarg.0 |
||||
IL_0001: callvirt instance class [mscorlib]System.Collections.IEnumerator [mscorlib]System.Collections.IEnumerable::GetEnumerator() |
||||
IL_0006: stloc.0 |
||||
.try |
||||
{ |
||||
IL_0007: br.s IL_0014 |
||||
|
||||
IL_0009: ldloc.0 |
||||
IL_000a: callvirt instance object [mscorlib]System.Collections.IEnumerator::get_Current() |
||||
IL_000f: call void [mscorlib]System.Console::WriteLine(object) |
||||
IL_0014: ldloc.0 |
||||
IL_0015: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_001a: brtrue.s IL_0009 |
||||
|
||||
IL_001c: leave.s IL_002f |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_001e: ldloc.0 |
||||
IL_001f: isinst [mscorlib]System.IDisposable |
||||
IL_0024: stloc.1 |
||||
IL_0025: ldloc.1 |
||||
IL_0026: brfalse.s IL_002e |
||||
|
||||
IL_0028: ldloc.1 |
||||
IL_0029: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_002e: endfinally |
||||
} // end handler |
||||
IL_002f: ret |
||||
} // end of method NoForEachStatement::SimpleNonGenericForeach |
||||
|
||||
.method public hidebysig static void SimpleForeachOverInts(class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> enumerable) cil managed |
||||
{ |
||||
// Code size 41 (0x29) |
||||
.maxstack 1 |
||||
.locals init (class [mscorlib]System.Collections.Generic.IEnumerator`1<int32> V_0) |
||||
IL_0000: ldarg.0 |
||||
IL_0001: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<int32>::GetEnumerator() |
||||
IL_0006: stloc.0 |
||||
.try |
||||
{ |
||||
IL_0007: br.s IL_0014 |
||||
|
||||
IL_0009: ldloc.0 |
||||
IL_000a: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<int32>::get_Current() |
||||
IL_000f: call void [mscorlib]System.Console::WriteLine(int32) |
||||
IL_0014: ldloc.0 |
||||
IL_0015: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_001a: brtrue.s IL_0009 |
||||
|
||||
IL_001c: leave.s IL_0028 |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_001e: ldloc.0 |
||||
IL_001f: brfalse.s IL_0027 |
||||
|
||||
IL_0021: ldloc.0 |
||||
IL_0022: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_0027: endfinally |
||||
} // end handler |
||||
IL_0028: ret |
||||
} // end of method NoForEachStatement::SimpleForeachOverInts |
||||
|
||||
.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 NoForEachStatement::.ctor |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
|
||||
|
||||
// ============================================================= |
||||
|
||||
// *********** DISASSEMBLY COMPLETE *********************** |
@ -0,0 +1,145 @@
@@ -0,0 +1,145 @@
|
||||
|
||||
|
||||
|
||||
|
||||
// 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 NoForEachStatement |
||||
{ |
||||
.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 NoForEachStatement.dll |
||||
.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 |
||||
|
||||
|
||||
// =============== CLASS MEMBERS DECLARATION =================== |
||||
|
||||
.class private auto ansi beforefieldinit ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
extends [mscorlib]System.Object |
||||
{ |
||||
.method public hidebysig static void SimpleNonGenericForeach(class [mscorlib]System.Collections.IEnumerable enumerable) cil managed |
||||
{ |
||||
// Code size 56 (0x38) |
||||
.maxstack 1 |
||||
.locals init (class [mscorlib]System.Collections.IEnumerator V_0, |
||||
object V_1, |
||||
class [mscorlib]System.IDisposable V_2) |
||||
IL_0000: nop |
||||
IL_0001: nop |
||||
IL_0002: ldarg.0 |
||||
IL_0003: callvirt instance class [mscorlib]System.Collections.IEnumerator [mscorlib]System.Collections.IEnumerable::GetEnumerator() |
||||
IL_0008: stloc.0 |
||||
.try |
||||
{ |
||||
IL_0009: br.s IL_001b |
||||
|
||||
IL_000b: ldloc.0 |
||||
IL_000c: callvirt instance object [mscorlib]System.Collections.IEnumerator::get_Current() |
||||
IL_0011: stloc.1 |
||||
IL_0012: nop |
||||
IL_0013: ldloc.1 |
||||
IL_0014: call void [mscorlib]System.Console::WriteLine(object) |
||||
IL_0019: nop |
||||
IL_001a: nop |
||||
IL_001b: ldloc.0 |
||||
IL_001c: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_0021: brtrue.s IL_000b |
||||
|
||||
IL_0023: leave.s IL_0037 |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_0025: ldloc.0 |
||||
IL_0026: isinst [mscorlib]System.IDisposable |
||||
IL_002b: stloc.2 |
||||
IL_002c: ldloc.2 |
||||
IL_002d: brfalse.s IL_0036 |
||||
|
||||
IL_002f: ldloc.2 |
||||
IL_0030: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_0035: nop |
||||
IL_0036: endfinally |
||||
} // end handler |
||||
IL_0037: ret |
||||
} // end of method NoForEachStatement::SimpleNonGenericForeach |
||||
|
||||
.method public hidebysig static void SimpleForeachOverInts(class [mscorlib]System.Collections.Generic.IEnumerable`1<int32> enumerable) cil managed |
||||
{ |
||||
// Code size 49 (0x31) |
||||
.maxstack 1 |
||||
.locals init (class [mscorlib]System.Collections.Generic.IEnumerator`1<int32> V_0, |
||||
int32 V_1) |
||||
IL_0000: nop |
||||
IL_0001: nop |
||||
IL_0002: ldarg.0 |
||||
IL_0003: callvirt instance class [mscorlib]System.Collections.Generic.IEnumerator`1<!0> class [mscorlib]System.Collections.Generic.IEnumerable`1<int32>::GetEnumerator() |
||||
IL_0008: stloc.0 |
||||
.try |
||||
{ |
||||
IL_0009: br.s IL_001b |
||||
|
||||
IL_000b: ldloc.0 |
||||
IL_000c: callvirt instance !0 class [mscorlib]System.Collections.Generic.IEnumerator`1<int32>::get_Current() |
||||
IL_0011: stloc.1 |
||||
IL_0012: nop |
||||
IL_0013: ldloc.1 |
||||
IL_0014: call void [mscorlib]System.Console::WriteLine(int32) |
||||
IL_0019: nop |
||||
IL_001a: nop |
||||
IL_001b: ldloc.0 |
||||
IL_001c: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() |
||||
IL_0021: brtrue.s IL_000b |
||||
|
||||
IL_0023: leave.s IL_0030 |
||||
|
||||
} // end .try |
||||
finally |
||||
{ |
||||
IL_0025: ldloc.0 |
||||
IL_0026: brfalse.s IL_002f |
||||
|
||||
IL_0028: ldloc.0 |
||||
IL_0029: callvirt instance void [mscorlib]System.IDisposable::Dispose() |
||||
IL_002e: nop |
||||
IL_002f: endfinally |
||||
} // end handler |
||||
IL_0030: ret |
||||
} // end of method NoForEachStatement::SimpleForeachOverInts |
||||
|
||||
.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 NoForEachStatement::.ctor |
||||
|
||||
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Ugly.NoForEachStatement |
||||
|
||||
|
||||
// ============================================================= |
||||
|
||||
// *********** DISASSEMBLY COMPLETE *********************** |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue