Browse Source

Rename TypeTests to EnumTests and merge old EnumTests into new pretty tests.

pull/1440/head
Siegfried Pammer 6 years ago
parent
commit
2edfac8f99
  1. 2
      ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs
  2. 86
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.cs
  3. 242
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.il
  4. 194
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.opt.il
  5. 198
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.opt.roslyn.il
  6. 247
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.roslyn.il
  7. 65
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.il
  8. 65
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.opt.il
  9. 69
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.opt.roslyn.il
  10. 70
      ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.roslyn.il
  11. 18
      ICSharpCode.Decompiler.Tests/Types/EnumTests.cs
  12. 129
      ICSharpCode.Decompiler.Tests/Types/S_EnumSamples.cs

2
ICSharpCode.Decompiler.Tests/PrettyTestRunner.cs

@ -384,7 +384,7 @@ namespace ICSharpCode.Decompiler.Tests @@ -384,7 +384,7 @@ namespace ICSharpCode.Decompiler.Tests
}
[Test]
public void TypeTests([ValueSource(nameof(defaultOptions))] CompilerOptions cscOptions)
public void EnumTests([ValueSource(nameof(defaultOptions))] CompilerOptions cscOptions)
{
RunForLibrary(cscOptions: cscOptions);
}

86
ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.cs → ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.cs

@ -20,16 +20,100 @@ using System; @@ -20,16 +20,100 @@ using System;
namespace ICSharpCode.Decompiler.Tests.TestCases.Pretty
{
internal class TypeTests
internal class EnumTests
{
public enum SimpleEnum
{
Item1,
Item2
}
public enum LongBasedEnum : long
{
Item1,
Item2
}
public enum LongWithInitializers : long
{
Item1 = 0L,
Item2 = 20L,
Item3 = 21L
}
public enum ShortWithInitializers : short
{
Item1 = 0,
Item2 = 20,
Item3 = 21
}
public enum ByteWithInitializers : byte
{
Item1 = 0,
Item2 = 20,
Item3 = 21
}
[Flags]
public enum SimpleFlagsEnum
{
None = 0x0,
Item1 = 0x1,
Item2 = 0x2,
Item3 = 0x4,
All = 0x7
}
[Flags]
public enum NegativeValueWithFlags
{
Value = -2147483647
}
public enum NegativeValueWithoutFlags
{
Value = -2147483647
}
public AttributeTargets SingleEnumValue()
{
return AttributeTargets.Class;
}
public AttributeTargets TwoEnumValuesOr()
{
return AttributeTargets.Class | AttributeTargets.Method;
}
public AttributeTargets ThreeEnumValuesOr()
{
return AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Parameter;
}
public AttributeTargets UnknownEnumValue()
{
return (AttributeTargets)1000000;
}
public AttributeTargets EnumAllValue()
{
return AttributeTargets.All;
}
public AttributeTargets EnumZeroValue()
{
return (AttributeTargets)0;
}
public object PreservingTypeWhenBoxed()
{
return AttributeTargets.Delegate;
}
public object PreservingTypeWhenBoxedTwoEnum()
{
return AttributeTargets.Class | AttributeTargets.Delegate;
}
}
}

242
ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.il

@ -0,0 +1,242 @@ @@ -0,0 +1,242 @@
// 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 EnumTests
{
.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 EnumTests.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.Pretty.EnumTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public SimpleEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item1 = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item2 = int32(0x00000001)
} // end of class SimpleEnum
.class auto ansi sealed nested public LongBasedEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item2 = int64(0x1)
} // end of class LongBasedEnum
.class auto ansi sealed nested public LongWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item2 = int64(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item3 = int64(0x15)
} // end of class LongWithInitializers
.class auto ansi sealed nested public ShortWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int16 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item1 = int16(0x0000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item2 = int16(0x0014)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item3 = int16(0x0015)
} // end of class ShortWithInitializers
.class auto ansi sealed nested public ByteWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname uint8 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item1 = uint8(0x00)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item2 = uint8(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item3 = uint8(0x15)
} // end of class ByteWithInitializers
.class auto ansi sealed nested public SimpleFlagsEnum
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum None = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item1 = int32(0x00000001)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item2 = int32(0x00000002)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item3 = int32(0x00000004)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum All = int32(0x00000007)
} // end of class SimpleFlagsEnum
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
SingleEnumValue() cil managed
{
// Code size 7 (0x7)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4.4
IL_0002: stloc.0
IL_0003: br.s IL_0005
IL_0005: ldloc.0
IL_0006: ret
} // end of method EnumTests::SingleEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
TwoEnumValuesOr() cil managed
{
// Code size 8 (0x8)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4.s 68
IL_0003: stloc.0
IL_0004: br.s IL_0006
IL_0006: ldloc.0
IL_0007: ret
} // end of method EnumTests::TwoEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
ThreeEnumValuesOr() cil managed
{
// Code size 11 (0xb)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4 0x844
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method EnumTests::ThreeEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
UnknownEnumValue() cil managed
{
// Code size 11 (0xb)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4 0xf4240
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method EnumTests::UnknownEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumAllValue() cil managed
{
// Code size 11 (0xb)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4 0x7fff
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method EnumTests::EnumAllValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumZeroValue() cil managed
{
// Code size 7 (0x7)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4.0
IL_0002: stloc.0
IL_0003: br.s IL_0005
IL_0005: ldloc.0
IL_0006: ret
} // end of method EnumTests::EnumZeroValue
.method public hidebysig instance object
PreservingTypeWhenBoxed() cil managed
{
// Code size 16 (0x10)
.maxstack 1
.locals init (object V_0)
IL_0000: nop
IL_0001: ldc.i4 0x1000
IL_0006: box [mscorlib]System.AttributeTargets
IL_000b: stloc.0
IL_000c: br.s IL_000e
IL_000e: ldloc.0
IL_000f: ret
} // end of method EnumTests::PreservingTypeWhenBoxed
.method public hidebysig instance object
PreservingTypeWhenBoxedTwoEnum() cil managed
{
// Code size 16 (0x10)
.maxstack 1
.locals init (object V_0)
IL_0000: nop
IL_0001: ldc.i4 0x1004
IL_0006: box [mscorlib]System.AttributeTargets
IL_000b: stloc.0
IL_000c: br.s IL_000e
IL_000e: ldloc.0
IL_000f: ret
} // end of method EnumTests::PreservingTypeWhenBoxedTwoEnum
.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 EnumTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

194
ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.opt.il

@ -0,0 +1,194 @@ @@ -0,0 +1,194 @@
// 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 EnumTests.opt
{
.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 EnumTests.opt.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.Pretty.EnumTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public SimpleEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item1 = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item2 = int32(0x00000001)
} // end of class SimpleEnum
.class auto ansi sealed nested public LongBasedEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item2 = int64(0x1)
} // end of class LongBasedEnum
.class auto ansi sealed nested public LongWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item2 = int64(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item3 = int64(0x15)
} // end of class LongWithInitializers
.class auto ansi sealed nested public ShortWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int16 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item1 = int16(0x0000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item2 = int16(0x0014)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item3 = int16(0x0015)
} // end of class ShortWithInitializers
.class auto ansi sealed nested public ByteWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname uint8 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item1 = uint8(0x00)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item2 = uint8(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item3 = uint8(0x15)
} // end of class ByteWithInitializers
.class auto ansi sealed nested public SimpleFlagsEnum
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum None = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item1 = int32(0x00000001)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item2 = int32(0x00000002)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item3 = int32(0x00000004)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum All = int32(0x00000007)
} // end of class SimpleFlagsEnum
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
SingleEnumValue() cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.4
IL_0001: ret
} // end of method EnumTests::SingleEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
TwoEnumValuesOr() cil managed
{
// Code size 3 (0x3)
.maxstack 8
IL_0000: ldc.i4.s 68
IL_0002: ret
} // end of method EnumTests::TwoEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
ThreeEnumValuesOr() cil managed
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldc.i4 0x844
IL_0005: ret
} // end of method EnumTests::ThreeEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
UnknownEnumValue() cil managed
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldc.i4 0xf4240
IL_0005: ret
} // end of method EnumTests::UnknownEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumAllValue() cil managed
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldc.i4 0x7fff
IL_0005: ret
} // end of method EnumTests::EnumAllValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumZeroValue() cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.0
IL_0001: ret
} // end of method EnumTests::EnumZeroValue
.method public hidebysig instance object
PreservingTypeWhenBoxed() cil managed
{
// Code size 11 (0xb)
.maxstack 8
IL_0000: ldc.i4 0x1000
IL_0005: box [mscorlib]System.AttributeTargets
IL_000a: ret
} // end of method EnumTests::PreservingTypeWhenBoxed
.method public hidebysig instance object
PreservingTypeWhenBoxedTwoEnum() cil managed
{
// Code size 11 (0xb)
.maxstack 8
IL_0000: ldc.i4 0x1004
IL_0005: box [mscorlib]System.AttributeTargets
IL_000a: ret
} // end of method EnumTests::PreservingTypeWhenBoxedTwoEnum
.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 EnumTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

198
ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.opt.roslyn.il

@ -0,0 +1,198 @@ @@ -0,0 +1,198 @@
// 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 EnumTests
{
.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 EnumTests.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.Pretty.EnumTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public SimpleEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item1 = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item2 = int32(0x00000001)
} // end of class SimpleEnum
.class auto ansi sealed nested public LongBasedEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item2 = int64(0x1)
} // end of class LongBasedEnum
.class auto ansi sealed nested public LongWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item2 = int64(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item3 = int64(0x15)
} // end of class LongWithInitializers
.class auto ansi sealed nested public ShortWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int16 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item1 = int16(0x0000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item2 = int16(0x0014)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item3 = int16(0x0015)
} // end of class ShortWithInitializers
.class auto ansi sealed nested public ByteWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname uint8 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item1 = uint8(0x00)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item2 = uint8(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item3 = uint8(0x15)
} // end of class ByteWithInitializers
.class auto ansi sealed nested public SimpleFlagsEnum
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum None = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item1 = int32(0x00000001)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item2 = int32(0x00000002)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item3 = int32(0x00000004)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum All = int32(0x00000007)
} // end of class SimpleFlagsEnum
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
SingleEnumValue() cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.4
IL_0001: ret
} // end of method EnumTests::SingleEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
TwoEnumValuesOr() cil managed
{
// Code size 3 (0x3)
.maxstack 8
IL_0000: ldc.i4.s 68
IL_0002: ret
} // end of method EnumTests::TwoEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
ThreeEnumValuesOr() cil managed
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldc.i4 0x844
IL_0005: ret
} // end of method EnumTests::ThreeEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
UnknownEnumValue() cil managed
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldc.i4 0xf4240
IL_0005: ret
} // end of method EnumTests::UnknownEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumAllValue() cil managed
{
// Code size 6 (0x6)
.maxstack 8
IL_0000: ldc.i4 0x7fff
IL_0005: ret
} // end of method EnumTests::EnumAllValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumZeroValue() cil managed
{
// Code size 2 (0x2)
.maxstack 8
IL_0000: ldc.i4.0
IL_0001: ret
} // end of method EnumTests::EnumZeroValue
.method public hidebysig instance object
PreservingTypeWhenBoxed() cil managed
{
// Code size 11 (0xb)
.maxstack 8
IL_0000: ldc.i4 0x1000
IL_0005: box [mscorlib]System.AttributeTargets
IL_000a: ret
} // end of method EnumTests::PreservingTypeWhenBoxed
.method public hidebysig instance object
PreservingTypeWhenBoxedTwoEnum() cil managed
{
// Code size 11 (0xb)
.maxstack 8
IL_0000: ldc.i4 0x1004
IL_0005: box [mscorlib]System.AttributeTargets
IL_000a: ret
} // end of method EnumTests::PreservingTypeWhenBoxedTwoEnum
.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 EnumTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

247
ICSharpCode.Decompiler.Tests/TestCases/Pretty/EnumTests.roslyn.il

@ -0,0 +1,247 @@ @@ -0,0 +1,247 @@
// 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 EnumTests
{
.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 EnumTests.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.Pretty.EnumTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public SimpleEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item1 = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleEnum Item2 = int32(0x00000001)
} // end of class SimpleEnum
.class auto ansi sealed nested public LongBasedEnum
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongBasedEnum Item2 = int64(0x1)
} // end of class LongBasedEnum
.class auto ansi sealed nested public LongWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int64 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item1 = int64(0x0)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item2 = int64(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/LongWithInitializers Item3 = int64(0x15)
} // end of class LongWithInitializers
.class auto ansi sealed nested public ShortWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int16 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item1 = int16(0x0000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item2 = int16(0x0014)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ShortWithInitializers Item3 = int16(0x0015)
} // end of class ShortWithInitializers
.class auto ansi sealed nested public ByteWithInitializers
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname uint8 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item1 = uint8(0x00)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item2 = uint8(0x14)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/ByteWithInitializers Item3 = uint8(0x15)
} // end of class ByteWithInitializers
.class auto ansi sealed nested public SimpleFlagsEnum
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum None = int32(0x00000000)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item1 = int32(0x00000001)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item2 = int32(0x00000002)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum Item3 = int32(0x00000004)
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/SimpleFlagsEnum All = int32(0x00000007)
} // end of class SimpleFlagsEnum
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
SingleEnumValue() cil managed
{
// Code size 7 (0x7)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4.4
IL_0002: stloc.0
IL_0003: br.s IL_0005
IL_0005: ldloc.0
IL_0006: ret
} // end of method EnumTests::SingleEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
TwoEnumValuesOr() cil managed
{
// Code size 8 (0x8)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4.s 68
IL_0003: stloc.0
IL_0004: br.s IL_0006
IL_0006: ldloc.0
IL_0007: ret
} // end of method EnumTests::TwoEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
ThreeEnumValuesOr() cil managed
{
// Code size 11 (0xb)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4 0x844
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method EnumTests::ThreeEnumValuesOr
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
UnknownEnumValue() cil managed
{
// Code size 11 (0xb)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4 0xf4240
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method EnumTests::UnknownEnumValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumAllValue() cil managed
{
// Code size 11 (0xb)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4 0x7fff
IL_0006: stloc.0
IL_0007: br.s IL_0009
IL_0009: ldloc.0
IL_000a: ret
} // end of method EnumTests::EnumAllValue
.method public hidebysig instance valuetype [mscorlib]System.AttributeTargets
EnumZeroValue() cil managed
{
// Code size 7 (0x7)
.maxstack 1
.locals init (valuetype [mscorlib]System.AttributeTargets V_0)
IL_0000: nop
IL_0001: ldc.i4.0
IL_0002: stloc.0
IL_0003: br.s IL_0005
IL_0005: ldloc.0
IL_0006: ret
} // end of method EnumTests::EnumZeroValue
.method public hidebysig instance object
PreservingTypeWhenBoxed() cil managed
{
// Code size 16 (0x10)
.maxstack 1
.locals init (object V_0)
IL_0000: nop
IL_0001: ldc.i4 0x1000
IL_0006: box [mscorlib]System.AttributeTargets
IL_000b: stloc.0
IL_000c: br.s IL_000e
IL_000e: ldloc.0
IL_000f: ret
} // end of method EnumTests::PreservingTypeWhenBoxed
.method public hidebysig instance object
PreservingTypeWhenBoxedTwoEnum() cil managed
{
// Code size 16 (0x10)
.maxstack 1
.locals init (object V_0)
IL_0000: nop
IL_0001: ldc.i4 0x1004
IL_0006: box [mscorlib]System.AttributeTargets
IL_000b: stloc.0
IL_000c: br.s IL_000e
IL_000e: ldloc.0
IL_000f: ret
} // end of method EnumTests::PreservingTypeWhenBoxedTwoEnum
.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 EnumTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.EnumTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

65
ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.il

@ -1,65 +0,0 @@ @@ -1,65 +0,0 @@
// 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 TypeTests
{
.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 TypeTests.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.Pretty.TypeTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.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 TypeTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

65
ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.opt.il

@ -1,65 +0,0 @@ @@ -1,65 +0,0 @@
// 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 TypeTests.opt
{
.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 TypeTests.opt.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.Pretty.TypeTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.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 TypeTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

69
ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.opt.roslyn.il

@ -1,69 +0,0 @@ @@ -1,69 +0,0 @@
// 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 TypeTests
{
.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 TypeTests.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.Pretty.TypeTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.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 TypeTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

70
ICSharpCode.Decompiler.Tests/TestCases/Pretty/TypeTests.roslyn.il

@ -1,70 +0,0 @@ @@ -1,70 +0,0 @@
// 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 TypeTests
{
.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 TypeTests.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.Pretty.TypeTests
extends [mscorlib]System.Object
{
.class auto ansi sealed nested public NegativeValueWithFlags
extends [mscorlib]System.Enum
{
.custom instance void [mscorlib]System.FlagsAttribute::.ctor() = ( 01 00 00 00 )
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithFlags Value = int32(0x80000001)
} // end of class NegativeValueWithFlags
.class auto ansi sealed nested public NegativeValueWithoutFlags
extends [mscorlib]System.Enum
{
.field public specialname rtspecialname int32 value__
.field public static literal valuetype ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests/NegativeValueWithoutFlags Value = int32(0x80000001)
} // end of class NegativeValueWithoutFlags
.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 TypeTests::.ctor
} // end of class ICSharpCode.Decompiler.Tests.TestCases.Pretty.TypeTests
// =============================================================
// *********** DISASSEMBLY COMPLETE ***********************

18
ICSharpCode.Decompiler.Tests/Types/EnumTests.cs

@ -1,18 +0,0 @@ @@ -1,18 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
namespace ICSharpCode.Decompiler.Tests.Types
{
[TestFixture]
public class EnumTests : DecompilerTestBase
{
[Test]
public void EnumSamples()
{
ValidateFileRoundtrip(@"Types\S_EnumSamples.cs");
}
}
}

129
ICSharpCode.Decompiler.Tests/Types/S_EnumSamples.cs

@ -1,129 +0,0 @@ @@ -1,129 +0,0 @@
// Copyright (c) 2014 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.
//$CS
using System;
//$CE
//$$ SingleValue
public class TS_SingleValue
{
public AttributeTargets Method()
{
return AttributeTargets.Class;
}
}
//$$ TwoValuesOr
public class TS_TwoValuesOr
{
public AttributeTargets Method()
{
return AttributeTargets.Class | AttributeTargets.Method;
}
}
//$$ ThreeValuesOr
public class TS_ThreeValuesOr
{
public AttributeTargets Method()
{
return AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Parameter;
}
}
//$$ UnknownNumericValue
public class TS_UnknownNumericValue
{
public AttributeTargets Method()
{
return (AttributeTargets)1000000;
}
}
//$$ AllValue
public class TS_AllValue
{
public AttributeTargets Method()
{
return AttributeTargets.All;
}
}
//$$ ZeroValue
public class TS_ZeroValue
{
public AttributeTargets Method()
{
return (AttributeTargets)0;
}
}
//$$ PreservingTypeWhenBoxed
public class TS_PreservingTypeWhenBoxed
{
public object Method()
{
return AttributeTargets.Delegate;
}
}
//$$ PreservingTypeWhenBoxedTwoEnum
public class TS_PreservingTypeWhenBoxedTwoEnum
{
public object Method()
{
return AttributeTargets.Class | AttributeTargets.Delegate;
}
}
//$$ DeclarationSimpleEnum
public enum TS_DeclarationSimpleEnum
{
Item1,
Item2
}
//$$ DeclarationLongBasedEnum
public enum TS_DeclarationLongBasedEnum : long
{
Item1,
Item2
}
//$$ DeclarationLongWithInitializers
public enum TS_DeclarationLongWithInitializers : long
{
Item1,
Item2 = 20L,
Item3
}
//$$ DeclarationShortWithInitializers
public enum TS_DeclarationShortWithInitializers : short
{
Item1,
Item2 = 20,
Item3
}
//$$ DeclarationByteWithInitializers
public enum TS_DeclarationByteWithInitializers : byte
{
Item1,
Item2 = 20,
Item3
}
//$$ DeclarationFlags
[Flags]
public enum TS_DeclarationFlags
{
None = 0,
Item1 = 1,
Item2 = 2,
Item3 = 4,
All = 7
}
Loading…
Cancel
Save