Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added tests for virtual/non-virtual override complex combinations.
- Loading branch information
Showing
16 changed files
with
423 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/IL2C.Core.Test.Target/ILConverters/Call/Call_Overload.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace IL2C.ILConverters | ||
{ | ||
[TestId("Call")] | ||
[TestCase("IL2C.ILConverters.Call_Overload", new[] { "Instance_Overload_ToString_System_Object", "ToString" })] | ||
[TestCase("CallTestABC", new[] { "Instance_Overload_ToString_IL2C_ILConverters_Call", "ToString" }, "ABC")] | ||
public class Call_Overload | ||
{ | ||
public string ToString(string value) | ||
{ | ||
return "CallTest" + value; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_ToString_System_Object(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_ToString_IL2C_ILConverters_Call(string value); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/IL2C.Core.Test.Target/ILConverters/Call/Call_Overload.il
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
.class public IL2C.ILConverters.Call_Overload | ||
{ | ||
.method public static string Instance_Overload_ToString_System_Object() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Call_Overload::.ctor() | ||
call instance string [mscorlib]System.Object::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Instance_Overload_ToString_IL2C_ILConverters_Call(string v) cil managed | ||
{ | ||
.maxstack 2 | ||
newobj instance void class IL2C.ILConverters.Call_Overload::.ctor() | ||
ldarg.0 | ||
call instance string IL2C.ILConverters.Call_Overload::ToString(string v) | ||
ret | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/IL2C.Core.Test.Target/ILConverters/Call/Call_Overload_Newslot_Virtual.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace IL2C.ILConverters | ||
{ | ||
[TestId("Call")] | ||
[TestCase("IL2C.ILConverters.Call_Overload_Newslot_Virtual", new[] { "Instance_Overload_Newslot_Virtual_ToString_System_Object", "ToString" })] | ||
[TestCase("CallTestABC", new[] { "Instance_Overload_Newslot_Virtual_ToString_IL2C_ILConverters_Call", "ToString" }, "ABC")] | ||
public class Call_Overload_Newslot_Virtual | ||
{ | ||
public new virtual string ToString() | ||
{ | ||
return "CallTest"; | ||
} | ||
|
||
public string ToString(string value) | ||
{ | ||
return "CallTest" + value; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_Newslot_Virtual_ToString_System_Object(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_Newslot_Virtual_ToString_NoArgument_IL2C_ILConverters_Call(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_Newslot_Virtual_ToString_IL2C_ILConverters_Call(string value); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/IL2C.Core.Test.Target/ILConverters/Call/Call_Overload_Newslot_Virtual.il
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.class public IL2C.ILConverters.Call_Overload_Newslot_Virtual | ||
{ | ||
.method public static string Instance_Overload_Newslot_Virtual_ToString_System_Object() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Call_Overload_Newslot_Virtual::.ctor() | ||
call instance string [mscorlib]System.Object::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Instance_Overload_Newslot_Virtual_ToString_NoArgument_IL2C_ILConverters_Call() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Call_Overload_Newslot_Virtual::.ctor() | ||
call instance string IL2C.ILConverters.Call_Overload_Newslot_Virtual::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Instance_Overload_Newslot_Virtual_ToString_IL2C_ILConverters_Call(string v) cil managed | ||
{ | ||
.maxstack 2 | ||
newobj instance void class IL2C.ILConverters.Call_Overload_Newslot_Virtual::.ctor() | ||
ldarg.0 | ||
call instance string IL2C.ILConverters.Call_Overload_Newslot_Virtual::ToString(string v) | ||
ret | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
tests/IL2C.Core.Test.Target/ILConverters/Call/Call_Overload_Virtual.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace IL2C.ILConverters | ||
{ | ||
[TestId("Call")] | ||
[TestCase("IL2C.ILConverters.Call_Overload_Virtual", new[] { "Instance_Overload_Virtual_ToString_System_Object", "ToString" })] | ||
[TestCase("CallTestABC", new[] { "Instance_Overload_Virtual_ToString_IL2C_ILConverters_Call", "ToString" }, "ABC")] | ||
public class Call_Overload_Virtual | ||
{ | ||
public override string ToString() | ||
{ | ||
return "CallTest"; | ||
} | ||
|
||
public string ToString(string value) | ||
{ | ||
return "CallTest" + value; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_Virtual_ToString_System_Object(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_Virtual_ToString_NoArgument_IL2C_ILConverters_Call(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Instance_Overload_Virtual_ToString_IL2C_ILConverters_Call(string value); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
tests/IL2C.Core.Test.Target/ILConverters/Call/Call_Overload_Virtual.il
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.class public IL2C.ILConverters.Call_Overload_Virtual | ||
{ | ||
.method public static string Instance_Overload_Virtual_ToString_System_Object() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Call_Overload_Virtual::.ctor() | ||
call instance string [mscorlib]System.Object::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Instance_Overload_Virtual_ToString_NoArgument_IL2C_ILConverters_Call() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Call_Overload_Virtual::.ctor() | ||
call instance string IL2C.ILConverters.Call_Overload_Virtual::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Instance_Overload_Virtual_ToString_IL2C_ILConverters_Call(string v) cil managed | ||
{ | ||
.maxstack 2 | ||
newobj instance void class IL2C.ILConverters.Call_Overload_Virtual::.ctor() | ||
ldarg.0 | ||
call instance string IL2C.ILConverters.Call_Overload_Virtual::ToString(string v) | ||
ret | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
tests/IL2C.Core.Test.Target/ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace IL2C.ILConverters | ||
{ | ||
public abstract class Callvirt_Derived2_Newslot_Virtual_Base | ||
{ | ||
protected Callvirt_Derived2_Newslot_Virtual_Base() | ||
{ | ||
} | ||
|
||
public new virtual string ToString() | ||
{ | ||
return "Callvirt_Derived_Base"; | ||
} | ||
} | ||
|
||
[TestId("Callvirt")] | ||
[TestCase("IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual", new[] { "Derived2_Newslot_Virtual_ToString_System_Object", "ToString" }, IncludeBaseTypes = true)] | ||
[TestCase("CallvirtTest", new[] { "Derived2_Newslot_Virtual_ToString_IL2C_ILConverters_Callvirt_Base", "ToString" }, IncludeBaseTypes = true)] | ||
[TestCase("CallvirtTest", new[] { "Derived2_Newslot_Virtual_ToString_IL2C_ILConverters_Callvirt", "ToString" }, IncludeBaseTypes = true)] | ||
public class Callvirt_Derived2_Newslot_Virtual : Callvirt_Derived2_Newslot_Virtual_Base | ||
{ | ||
public override string ToString() | ||
{ | ||
return "CallvirtTest"; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived2_Newslot_Virtual_ToString_System_Object(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived2_Newslot_Virtual_ToString_IL2C_ILConverters_Callvirt_Base(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived2_Newslot_Virtual_ToString_IL2C_ILConverters_Callvirt(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
tests/IL2C.Core.Test.Target/ILConverters/Callvirt/Callvirt_Derived2_Newslot_Virtual.il
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
.class public IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual | ||
{ | ||
.method public static string Derived2_Newslot_Virtual_ToString_System_Object() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual::.ctor() | ||
callvirt instance string [mscorlib]System.Object::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Derived2_Newslot_Virtual_ToString_IL2C_ILConverters_Callvirt_Base() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual::.ctor() | ||
callvirt instance string IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual_Base::ToString() | ||
ret | ||
} | ||
|
||
.method public static string Derived2_Newslot_Virtual_ToString_IL2C_ILConverters_Callvirt() cil managed | ||
{ | ||
.maxstack 1 | ||
newobj instance void class IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual::.ctor() | ||
callvirt instance string IL2C.ILConverters.Callvirt_Derived2_Newslot_Virtual::ToString() | ||
ret | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
tests/IL2C.Core.Test.Target/ILConverters/Callvirt/Callvirt_Derived3_Newslot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using System; | ||
using System.Runtime.CompilerServices; | ||
|
||
namespace IL2C.ILConverters | ||
{ | ||
public abstract class Callvirt_Derived3_Newslot_Base1 | ||
{ | ||
protected Callvirt_Derived3_Newslot_Base1() | ||
{ | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return "Callvirt_Derived_Base1"; | ||
} | ||
} | ||
|
||
public abstract class Callvirt_Derived3_Newslot_Base2 : Callvirt_Derived3_Newslot_Base1 | ||
{ | ||
protected Callvirt_Derived3_Newslot_Base2() | ||
{ | ||
} | ||
|
||
public new string ToString() | ||
{ | ||
return "Callvirt_Derived_Base2"; | ||
} | ||
} | ||
|
||
[TestId("Callvirt")] | ||
[TestCase("Callvirt_Derived_Base1", new[] { "Derived3_Newslot_ToString_System_Object", "ToString" }, IncludeBaseTypes = true)] | ||
[TestCase("Callvirt_Derived_Base1", new[] { "Derived3_Newslot_ToString_IL2C_ILConverters_Callvirt_Base1", "ToString" }, IncludeBaseTypes = true)] | ||
[TestCase("Callvirt_Derived_Base2", new[] { "Derived3_Newslot_ToString_IL2C_ILConverters_Callvirt_Base2", "ToString" }, IncludeBaseTypes = true)] | ||
[TestCase("CallvirtTest", new[] { "Derived3_Newslot_ToString_IL2C_ILConverters_Callvirt", "ToString" }, IncludeBaseTypes = true)] | ||
public sealed class Callvirt_Derived3_Newslot : Callvirt_Derived3_Newslot_Base2 | ||
{ | ||
public new string ToString() | ||
{ | ||
return "CallvirtTest"; | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived3_Newslot_ToString_System_Object(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived3_Newslot_ToString_IL2C_ILConverters_Callvirt_Base1(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived3_Newslot_ToString_IL2C_ILConverters_Callvirt_Base2(); | ||
|
||
[MethodImpl(MethodImplOptions.ForwardRef)] | ||
public static extern string Derived3_Newslot_ToString_IL2C_ILConverters_Callvirt(); | ||
} | ||
} |
Oops, something went wrong.