Browse Source

Disable Test9

pull/2005/head
Siegfried Pammer 5 years ago
parent
commit
be8c83e1a4
  1. 16
      ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.Expected.cs
  2. 20
      ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.cs
  3. 30
      ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.opt.roslyn.il
  4. 32
      ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.roslyn.il
  5. 4
      ICSharpCode.Decompiler/DecompilerSettings.cs

16
ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.Expected.cs

@ -156,13 +156,13 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly
Console.WriteLine("{0} {1}", field1, field2); Console.WriteLine("{0} {1}", field1, field2);
} }
public void Test9() // public void Test9()
{ // {
Program thisField = this; // Program thisField = this;
int field1 = 1; // int field1 = 1;
string field2 = "Hello World!"; // string field2 = "Hello World!";
thisField = new Program(); // thisField = new Program();
Console.WriteLine("{0} {1}", this, thisField); // Console.WriteLine("{0} {1}", this, thisField);
} // }
} }
} }

20
ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.cs

@ -170,15 +170,15 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Ugly
Console.WriteLine("{0} {1}", displayClass.field1, displayClass.field2); Console.WriteLine("{0} {1}", displayClass.field1, displayClass.field2);
} }
public void Test9() // public void Test9()
{ // {
DisplayClass displayClass = new DisplayClass { // DisplayClass displayClass = new DisplayClass {
thisField = this, // thisField = this,
field1 = 1, // field1 = 1,
field2 = "Hello World!" // field2 = "Hello World!"
}; // };
displayClass.thisField = new Program(); // displayClass.thisField = new Program();
Console.WriteLine("{0} {1}", this, displayClass.thisField); // Console.WriteLine("{0} {1}", this, displayClass.thisField);
} // }
} }
} }

30
ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.opt.roslyn.il

@ -491,36 +491,6 @@
IL_0038: ret IL_0038: ret
} // end of method Program::Test8b } // end of method Program::Test8b
.method public hidebysig instance void
Test9() cil managed
{
// Code size 60 (0x3c)
.maxstack 3
.locals init (class ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass V_0)
IL_0000: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::.ctor()
IL_0005: dup
IL_0006: ldarg.0
IL_0007: stfld class ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::thisField
IL_000c: dup
IL_000d: ldc.i4.1
IL_000e: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::field1
IL_0013: dup
IL_0014: ldstr "Hello World!"
IL_0019: stfld string ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::field2
IL_001e: stloc.0
IL_001f: ldloc.0
IL_0020: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program::.ctor()
IL_0025: stfld class ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::thisField
IL_002a: ldstr "{0} {1}"
IL_002f: ldarg.0
IL_0030: ldloc.0
IL_0031: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::thisField
IL_0036: call void [mscorlib]System.Console::WriteLine(string,
object,
object)
IL_003b: ret
} // end of method Program::Test9
.method public hidebysig specialname rtspecialname .method public hidebysig specialname rtspecialname
instance void .ctor() cil managed instance void .ctor() cil managed
{ {

32
ICSharpCode.Decompiler.Tests/TestCases/Ugly/AggressiveScalarReplacementOfAggregates.roslyn.il

@ -558,38 +558,6 @@
IL_003a: ret IL_003a: ret
} // end of method Program::Test8b } // end of method Program::Test8b
.method public hidebysig instance void
Test9() cil managed
{
// Code size 62 (0x3e)
.maxstack 3
.locals init (class ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass V_0)
IL_0000: nop
IL_0001: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::.ctor()
IL_0006: dup
IL_0007: ldarg.0
IL_0008: stfld class ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::thisField
IL_000d: dup
IL_000e: ldc.i4.1
IL_000f: stfld int32 ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::field1
IL_0014: dup
IL_0015: ldstr "Hello World!"
IL_001a: stfld string ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::field2
IL_001f: stloc.0
IL_0020: ldloc.0
IL_0021: newobj instance void ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program::.ctor()
IL_0026: stfld class ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::thisField
IL_002b: ldstr "{0} {1}"
IL_0030: ldarg.0
IL_0031: ldloc.0
IL_0032: ldfld class ICSharpCode.Decompiler.Tests.TestCases.Ugly.Program ICSharpCode.Decompiler.Tests.TestCases.Ugly.DisplayClass::thisField
IL_0037: call void [mscorlib]System.Console::WriteLine(string,
object,
object)
IL_003c: nop
IL_003d: ret
} // end of method Program::Test9
.method public hidebysig specialname rtspecialname .method public hidebysig specialname rtspecialname
instance void .ctor() cil managed instance void .ctor() cil managed
{ {

4
ICSharpCode.Decompiler/DecompilerSettings.cs

@ -1333,6 +1333,10 @@ namespace ICSharpCode.Decompiler
[Category("DecompilerSettings.Other")] [Category("DecompilerSettings.Other")]
[Description("DecompilerSettings.AggressiveScalarReplacementOfAggregates")] [Description("DecompilerSettings.AggressiveScalarReplacementOfAggregates")]
// TODO : Remove once https://github.com/icsharpcode/ILSpy/issues/2032 is fixed.
#if !DEBUG
[Browsable(false)]
#endif
public bool AggressiveScalarReplacementOfAggregates { public bool AggressiveScalarReplacementOfAggregates {
get { return aggressiveScalarReplacementOfAggregates; } get { return aggressiveScalarReplacementOfAggregates; }
set { set {

Loading…
Cancel
Save