Browse Source

Split Async tests

pull/863/head
Siegfried Pammer 8 years ago
parent
commit
c27231955a
  1. 6
      ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs
  2. 3
      ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj
  3. 2
      ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
  4. 188
      ICSharpCode.Decompiler.Tests/TestCases/Correctness/Async.cs
  5. 114
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs
  6. 1607
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.il
  7. 1436
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.il
  8. 1348
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.roslyn.il
  9. 1629
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.roslyn.il
  10. 72
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.il
  11. 62
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.opt.il
  12. 54
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.opt.roslyn.il
  13. 56
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.roslyn.il

6
ICSharpCode.Decompiler.Tests/CorrectnessTestRunner.cs

@ -174,6 +174,12 @@ namespace ICSharpCode.Decompiler.Tests @@ -174,6 +174,12 @@ namespace ICSharpCode.Decompiler.Tests
RunCS(options: options);
}
[Test, Ignore("Run() method cannot be fully decompiled.")]
public void Async([ValueSource("defaultOptions")] CompilerOptions options)
{
RunCS(options: options);
}
void RunCS([CallerMemberName] string testName = null, CompilerOptions options = CompilerOptions.UseDebug)
{
string testFileName = testName + ".cs";

3
ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj

@ -58,13 +58,14 @@ @@ -58,13 +58,14 @@
<Compile Include="Stub.cs" />
<Compile Include="TestCases\Correctness\TrickyTypes.cs" />
<Compile Include="TestCases\ILPretty\Issue379.cs" />
<Compile Include="TestCases\Pretty\Async.cs" />
<Compile Include="TestCases\Pretty\LiftedOperators.cs" />
<Compile Include="PrettyTestRunner.cs" />
<Compile Include="RoundtripAssembly.cs" />
<Compile Include="TestCases\Correctness\Capturing.cs" />
<Compile Include="TestCases\Correctness\OverloadResolution.cs" />
<Compile Include="TestCases\Pretty\AnonymousTypes.cs" />
<Compile Include="TestCases\Pretty\Async.cs" />
<Compile Include="TestCases\Correctness\Async.cs" />
<Compile Include="TestCases\Correctness\CompoundAssignment.cs" />
<Compile Include="TestCases\Correctness\ConditionalAttr.cs" />
<Compile Include="TestCases\Correctness\ControlFlow.cs" />

2
ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs

@ -103,7 +103,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -103,7 +103,7 @@ namespace ICSharpCode.Decompiler.Tests
Run(cscOptions: cscOptions);
}
[Test, Ignore("Not implemented")]
[Test]
public void Async([ValueSource("defaultOptions")] CompilerOptions cscOptions)
{
Run(cscOptions: cscOptions);

188
ICSharpCode.Decompiler.Tests/TestCases/Correctness/Async.cs

@ -0,0 +1,188 @@ @@ -0,0 +1,188 @@
// 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.
#pragma warning disable 1998
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
namespace ICSharpCode.Decompiler.Tests.TestCases.Correctness
{
public class Async
{
public static void Main()
{
new Async().Run();
}
public async void Run()
{
await SimpleBoolTaskMethod();
StreamCopyTo(new MemoryStream(new byte[1024]), 16);
StreamCopyToWithConfigureAwait(new MemoryStream(new byte[1024]), 16);
await AwaitInForEach(Enumerable.Range(0, 100).Select(i => Task<int>.FromResult(i)));
await TaskMethodWithoutAwaitButWithExceptionHandling();
#if !LEGACY_CSC
await AwaitCatch(Task.FromResult(1));
await AwaitFinally(Task.FromResult(2));
#endif
await NestedAwait(Task.FromResult(Task.FromResult(5)));
await AwaitWithStack(Task.FromResult(3));
await AwaitWithStack2(Task.FromResult(4));
#if !LEGACY_CSC
await AwaitInCatch(Task.FromResult(1), Task.FromResult(2));
await AwaitInFinally(Task.FromResult(2), Task.FromResult(4));
#endif
}
public async Task<bool> SimpleBoolTaskMethod()
{
Console.WriteLine("Before");
await Task.Delay(TimeSpan.FromSeconds(1.0));
Console.WriteLine("After");
return true;
}
public async void StreamCopyTo(Stream destination, int bufferSize)
{
Console.WriteLine("Before");
byte[] array = new byte[bufferSize];
int count;
Console.WriteLine("BeforeLoop");
while ((count = await destination.ReadAsync(array, 0, array.Length)) != 0) {
Console.WriteLine("In Loop after condition!");
await destination.WriteAsync(array, 0, count);
Console.WriteLine("In Loop after inner await");
}
Console.WriteLine("After");
}
public async void StreamCopyToWithConfigureAwait(Stream destination, int bufferSize)
{
Console.WriteLine("Before");
byte[] array = new byte[bufferSize];
int count;
Console.WriteLine("Before Loop");
while ((count = await destination.ReadAsync(array, 0, array.Length).ConfigureAwait(false)) != 0) {
Console.WriteLine("Before Inner Await");
await destination.WriteAsync(array, 0, count).ConfigureAwait(false);
Console.WriteLine("After Inner Await");
}
Console.WriteLine("After");
}
public async Task<int> AwaitInForEach(IEnumerable<Task<int>> elements)
{
int num = 0;
Console.WriteLine("Before Loop");
foreach (Task<int> current in elements) {
Console.WriteLine("Before Inner Await");
num += await current;
Console.WriteLine("After Inner Await");
}
Console.WriteLine("After");
return num;
}
public async Task TaskMethodWithoutAwaitButWithExceptionHandling()
{
try {
using (new StringWriter()) {
Console.WriteLine("No Await");
}
} catch (Exception) {
Console.WriteLine("Crash");
}
}
#if !LEGACY_CSC
public async Task AwaitCatch(Task<int> task)
{
try {
Console.WriteLine("Before throw");
throw new Exception();
} catch {
Console.WriteLine(await task);
}
}
public async Task AwaitFinally(Task<int> task)
{
try {
Console.WriteLine("Before throw");
throw new Exception();
} finally {
Console.WriteLine(await task);
}
}
#endif
public async Task<int> NestedAwait(Task<Task<int>> task)
{
return await (await task);
}
public async Task AwaitWithStack(Task<int> task)
{
Console.WriteLine("A", 1, await task);
}
public async Task AwaitWithStack2(Task<int> task)
{
if (await this.SimpleBoolTaskMethod()) {
Console.WriteLine("A", 1, await task);
} else {
int num = 1;
Console.WriteLine("A", 1, num);
}
}
#if !LEGACY_CSC
public async Task AwaitInCatch(Task<int> task1, Task<int> task2)
{
try {
Console.WriteLine("Start try");
await task1;
Console.WriteLine("End try");
} catch (Exception) {
Console.WriteLine("Start catch");
await task2;
Console.WriteLine("End catch");
}
Console.WriteLine("End Method");
}
public async Task AwaitInFinally(Task<int> task1, Task<int> task2)
{
try {
Console.WriteLine("Start try");
await task1;
Console.WriteLine("End try");
} finally {
Console.WriteLine("Start finally");
await task2;
Console.WriteLine("End finally");
}
Console.WriteLine("End Method");
}
#endif
}
}

114
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.cs

@ -18,8 +18,6 @@ @@ -18,8 +18,6 @@
#pragma warning disable 1998
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.CompilerServices;
using System.Threading.Tasks;
@ -82,121 +80,11 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -82,121 +80,11 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
Console.WriteLine("After");
}
public async void StreamCopyTo(Stream destination, int bufferSize)
{
byte[] array = new byte[bufferSize];
int count;
while ((count = await destination.ReadAsync(array, 0, array.Length)) != 0) {
await destination.WriteAsync(array, 0, count);
}
}
public async void StreamCopyToWithConfigureAwait(Stream destination, int bufferSize)
{
byte[] array = new byte[bufferSize];
int count;
while ((count = await destination.ReadAsync(array, 0, array.Length).ConfigureAwait(false)) != 0) {
await destination.WriteAsync(array, 0, count).ConfigureAwait(false);
}
}
public async void AwaitInLoopCondition()
{
while (await this.SimpleBoolTaskMethod()) {
Console.WriteLine("Body");
}
}
public async Task<int> AwaitInForEach(IEnumerable<Task<int>> elements)
{
int num = 0;
foreach (Task<int> current in elements) {
num += await current;
}
return num;
}
public async Task TaskMethodWithoutAwaitButWithExceptionHandling()
{
try {
using (new StringWriter()) {
Console.WriteLine("No Await");
}
} catch (Exception) {
Console.WriteLine("Crash");
}
}
#if !LEGACY_CSC
public async Task AwaitCatch(Task<int> task)
{
try {
Console.WriteLine("Before throw");
throw new Exception();
} catch {
Console.WriteLine(await task);
}
}
public async Task AwaitFinally(Task<int> task)
{
try {
Console.WriteLine("Before throw");
throw new Exception();
} finally {
Console.WriteLine(await task);
}
}
#endif
public async Task<int> NestedAwait(Task<Task<int>> task)
{
return await (await task);
}
public async Task AwaitWithStack(Task<int> task)
{
Console.WriteLine("A", 1, await task);
}
public async Task AwaitWithStack2(Task<int> task)
{
if (await this.SimpleBoolTaskMethod()) {
Console.WriteLine("A", 1, await task);
} else {
int num = 1;
Console.WriteLine("A", 1, num);
}
}
#if !LEGACY_CSC
public async Task AwaitInCatch(Task<int> task1, Task<int> task2)
{
try {
Console.WriteLine("Start try");
await task1;
Console.WriteLine("End try");
} catch (Exception) {
Console.WriteLine("Start catch");
await task2;
Console.WriteLine("End catch");
}
Console.WriteLine("End Method");
}
public async Task AwaitInFinally(Task<int> task1, Task<int> task2)
{
try {
Console.WriteLine("Start try");
await task1;
Console.WriteLine("End try");
} finally {
Console.WriteLine("Start finally");
await task2;
Console.WriteLine("End finally");
}
Console.WriteLine("End Method");
}
#endif
}
}
}

1607
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.il

File diff suppressed because it is too large Load Diff

1436
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.il

File diff suppressed because it is too large Load Diff

1348
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.opt.roslyn.il

File diff suppressed because it is too large Load Diff

1629
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Async.roslyn.il

File diff suppressed because it is too large Load Diff

72
ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.il

@ -10,25 +10,25 @@ @@ -10,25 +10,25 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly yrrhbyx4
.assembly rxpttcc3
{
.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.
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 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 yrrhbyx4.dll
// MVID: {82665BB0-B310-40F8-A171-DB3485D8CA3B}
.module rxpttcc3.dll
// MVID: {1FF2BE16-6925-4D61-92AB-530ECA34D69F}
.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: 0x01350000
// Image base: 0x01200000
// =============== CLASS MEMBERS DECLARATION ===================
@ -42,6 +42,34 @@ @@ -42,6 +42,34 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.EventHandler 'CS$<>9__CachedAnonymousMethodDelegate1'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
.maxstack 1
.locals init (int32 V_0)
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname instance void
add_AutomaticEvent(class [mscorlib]System.EventHandler 'value') cil managed
{
@ -228,34 +256,6 @@ @@ -228,34 +256,6 @@
IL_0009: ret
} // end of method PropertiesAndEvents::remove_CustomEvent
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 11 (0xb)
.maxstack 1
.locals init (int32 V_0)
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@ -298,13 +298,13 @@ @@ -298,13 +298,13 @@
} // end of event PropertiesAndEvents::AutomaticEvent
.event [mscorlib]System.EventHandler AutomaticEventWithInitializer
{
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_AutomaticEventWithInitializer(class [mscorlib]System.EventHandler)
.addon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::add_AutomaticEventWithInitializer(class [mscorlib]System.EventHandler)
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_AutomaticEventWithInitializer(class [mscorlib]System.EventHandler)
} // end of event PropertiesAndEvents::AutomaticEventWithInitializer
.event [mscorlib]System.EventHandler CustomEvent
{
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_CustomEvent(class [mscorlib]System.EventHandler)
.addon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::add_CustomEvent(class [mscorlib]System.EventHandler)
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_CustomEvent(class [mscorlib]System.EventHandler)
} // end of event PropertiesAndEvents::CustomEvent
.property instance int32 Value()
{
@ -317,4 +317,4 @@ @@ -317,4 +317,4 @@
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file ../../Tests/TestCases/Pretty\PropertiesAndEvents.res
// WARNING: Created Win32 resource file ../../../TestCases/Pretty\PropertiesAndEvents.res

62
ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.opt.il

@ -10,25 +10,25 @@ @@ -10,25 +10,25 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly mntxd4ks
.assembly izb3o5sr
{
.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.
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 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 mntxd4ks.dll
// MVID: {29E42430-0417-4F94-9661-223B88060574}
.module izb3o5sr.dll
// MVID: {8A2B95C7-4655-426C-A216-92C7BBB9D7D5}
.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: 0x03170000
// Image base: 0x00DE0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -42,6 +42,29 @@ @@ -42,6 +42,29 @@
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private static class [mscorlib]System.EventHandler 'CS$<>9__CachedAnonymousMethodDelegate1'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname instance void
add_AutomaticEvent(class [mscorlib]System.EventHandler 'value') cil managed
{
@ -200,29 +223,6 @@ @@ -200,29 +223,6 @@
IL_0007: ret
} // end of method PropertiesAndEvents::remove_CustomEvent
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{
@ -261,13 +261,13 @@ @@ -261,13 +261,13 @@
} // end of event PropertiesAndEvents::AutomaticEvent
.event [mscorlib]System.EventHandler AutomaticEventWithInitializer
{
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_AutomaticEventWithInitializer(class [mscorlib]System.EventHandler)
.addon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::add_AutomaticEventWithInitializer(class [mscorlib]System.EventHandler)
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_AutomaticEventWithInitializer(class [mscorlib]System.EventHandler)
} // end of event PropertiesAndEvents::AutomaticEventWithInitializer
.event [mscorlib]System.EventHandler CustomEvent
{
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_CustomEvent(class [mscorlib]System.EventHandler)
.addon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::add_CustomEvent(class [mscorlib]System.EventHandler)
.removeon instance void ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::remove_CustomEvent(class [mscorlib]System.EventHandler)
} // end of event PropertiesAndEvents::CustomEvent
.property instance int32 Value()
{
@ -280,4 +280,4 @@ @@ -280,4 +280,4 @@
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file ../../Tests/TestCases/Pretty\PropertiesAndEvents.opt.res
// WARNING: Created Win32 resource file ../../../TestCases/Pretty\PropertiesAndEvents.opt.res

54
ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.opt.roslyn.il

@ -25,14 +25,14 @@ @@ -25,14 +25,14 @@
.ver 0:0:0:0
}
.module PropertiesAndEvents.dll
// MVID: {D731F1E1-A512-4199-834A-9BCA95572A0B}
// MVID: {10E5705F-7F26-4317-B44C-F957A4E21EAC}
.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: 0x02610000
// Image base: 0x015B0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -77,12 +77,35 @@ @@ -77,12 +77,35 @@
} // end of class '<>c'
.field private int32 '<Value>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private class [mscorlib]System.EventHandler AutomaticEvent
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private notserialized class [mscorlib]System.EventHandler AutomaticEventWithInitializer
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.field private int32 '<Value>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname instance void
add_AutomaticEvent(class [mscorlib]System.EventHandler 'value') cil managed
{
@ -245,29 +268,6 @@ @@ -245,29 +268,6 @@
IL_0007: ret
} // end of method PropertiesAndEvents::remove_CustomEvent
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{

56
ICSharpCode.Decompiler.Tests/TestCases/Pretty/PropertiesAndEvents.roslyn.il

@ -25,14 +25,14 @@ @@ -25,14 +25,14 @@
.ver 0:0:0:0
}
.module PropertiesAndEvents.dll
// MVID: {C89A39C6-EF4C-4E8A-AC45-3619FA7A8CCD}
// MVID: {978432C8-A999-48CF-A173-68805B029A1E}
.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: 0x017D0000
// Image base: 0x00E70000
// =============== CLASS MEMBERS DECLARATION ===================
@ -79,15 +79,38 @@ @@ -79,15 +79,38 @@
} // end of class '<>c'
.field private class [mscorlib]System.EventHandler AutomaticEvent
.field private int32 '<Value>k__BackingField'
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field private notserialized class [mscorlib]System.EventHandler AutomaticEventWithInitializer
.field private class [mscorlib]System.EventHandler AutomaticEvent
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
.field private int32 '<Value>k__BackingField'
.field private notserialized class [mscorlib]System.EventHandler AutomaticEventWithInitializer
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
.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 int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname instance void
add_AutomaticEvent(class [mscorlib]System.EventHandler 'value') cil managed
{
@ -254,29 +277,6 @@ @@ -254,29 +277,6 @@
IL_0009: ret
} // end of method PropertiesAndEvents::remove_CustomEvent
.method public hidebysig specialname instance int32
get_Value() cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 7 (0x7)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0006: ret
} // end of method PropertiesAndEvents::get_Value
.method private hidebysig specialname instance void
set_Value(int32 'value') cil managed
{
.custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
// Code size 8 (0x8)
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldarg.1
IL_0002: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Pretty.PropertiesAndEvents::'<Value>k__BackingField'
IL_0007: ret
} // end of method PropertiesAndEvents::set_Value
.method public hidebysig specialname rtspecialname
instance void .ctor() cil managed
{

Loading…
Cancel
Save