Browse Source

Add regression test for foreach variable naming.

pull/946/head
Siegfried Pammer 8 years ago
parent
commit
0ab805a603
  1. 6
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.cs
  2. 16
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.il
  3. 16
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.opt.il
  4. 10
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.opt.roslyn.il
  5. 10
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.roslyn.il

6
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.cs

@ -260,10 +260,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty @@ -260,10 +260,10 @@ namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
}
public void ForEach(IEnumerable<string> enumerable)
public void ForEach(IEnumerable<string> alternatives)
{
foreach (string item in enumerable) {
item.ToLower();
foreach (string alternative in alternatives) {
alternative.ToLower();
}
}

16
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.il

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929
// Copyright (c) Microsoft Corporation. All rights reserved.
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly y5enlto2
.assembly y1gx1hfa
{
.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
@ -20,15 +20,15 @@ @@ -20,15 +20,15 @@
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module y5enlto2.dll
// MVID: {7F6CCF81-BE23-4326-8F55-7E3BF0A8B7A2}
.module y1gx1hfa.dll
// MVID: {21EB73BD-6DA1-4305-9961-7F543EB0E1F3}
.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: 0x009B0000
// Image base: 0x02A00000
// =============== CLASS MEMBERS DECLARATION ===================
@ -635,7 +635,7 @@ @@ -635,7 +635,7 @@
} // end of method Loops::Operation
.method public hidebysig instance void
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> enumerable) cil managed
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> alternatives) cil managed
{
// Code size 57 (0x39)
.maxstack 2
@ -1750,4 +1750,4 @@ @@ -1750,4 +1750,4 @@
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file ../../../TestCases/Pretty\Loops.res
// Warnung: Win32-Ressourcendatei "../../../TestCases/Pretty\Loops.res" wurde erstellt.

16
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.opt.il

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929
// Copyright (c) Microsoft Corporation. All rights reserved.
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4..
.ver 4:0:0:0
}
.assembly jiaqp12i
.assembly de0u0jkz
{
.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
@ -20,15 +20,15 @@ @@ -20,15 +20,15 @@
.hash algorithm 0x00008004
.ver 0:0:0:0
}
.module jiaqp12i.dll
// MVID: {34208704-52B8-49EB-BC77-C3A95E1CBA19}
.module de0u0jkz.dll
// MVID: {F3F9EFD3-F9A8-4885-B2D2-AD75367C0339}
.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: 0x02520000
// Image base: 0x01A60000
// =============== CLASS MEMBERS DECLARATION ===================
@ -550,7 +550,7 @@ @@ -550,7 +550,7 @@
} // end of method Loops::Operation
.method public hidebysig instance void
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> enumerable) cil managed
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> alternatives) cil managed
{
// Code size 44 (0x2c)
.maxstack 1
@ -1361,4 +1361,4 @@ @@ -1361,4 +1361,4 @@
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************
// WARNING: Created Win32 resource file ../../../TestCases/Pretty\Loops.opt.res
// Warnung: Win32-Ressourcendatei "../../../TestCases/Pretty\Loops.opt.res" wurde erstellt.

10
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.opt.roslyn.il

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929
// Copyright (c) Microsoft Corporation. All rights reserved.
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
@ -25,14 +25,14 @@ @@ -25,14 +25,14 @@
.ver 0:0:0:0
}
.module Loops.dll
// MVID: {8D392B4A-5D21-407A-B579-FCDFA93069CE}
// MVID: {13449EE0-18A5-44A4-B482-40B5C738DFBB}
.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: 0x00DA0000
// Image base: 0x00D70000
// =============== CLASS MEMBERS DECLARATION ===================
@ -554,7 +554,7 @@ @@ -554,7 +554,7 @@
} // end of method Loops::Operation
.method public hidebysig instance void
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> enumerable) cil managed
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> alternatives) cil managed
{
// Code size 42 (0x2a)
.maxstack 1

10
ICSharpCode.Decompiler.Tests/TestCases/Pretty/Loops.roslyn.il

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.17929
// Copyright (c) Microsoft Corporation. All rights reserved.
// Microsoft (R) .NET Framework IL Disassembler. Version 4.6.1055.0
// Copyright (c) Microsoft Corporation. Alle Rechte vorbehalten.
@ -25,14 +25,14 @@ @@ -25,14 +25,14 @@
.ver 0:0:0:0
}
.module Loops.dll
// MVID: {C6DBFA5B-CB31-4084-8E6F-7BA877923008}
// MVID: {747E198F-8825-4B5B-9C27-DF069E6F35AE}
.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: 0x00A80000
// Image base: 0x027A0000
// =============== CLASS MEMBERS DECLARATION ===================
@ -639,7 +639,7 @@ @@ -639,7 +639,7 @@
} // end of method Loops::Operation
.method public hidebysig instance void
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> enumerable) cil managed
ForEach(class [mscorlib]System.Collections.Generic.IEnumerable`1<string> alternatives) cil managed
{
// Code size 49 (0x31)
.maxstack 1

Loading…
Cancel
Save