2 // vararg.il: Tests for varargs and refany instructions
5 .assembly extern mscorlib {
8 .assembly extern TestDriver {
16 .class public auto ansi Tests extends [mscorlib]System.Object {
18 .method public static vararg void varargtest () cil managed {
21 valuetype [mscorlib]System.ArgIterator it
26 call instance void [mscorlib]System.ArgIterator::.ctor (valuetype [mscorlib]System.RuntimeArgumentHandle)
29 call instance int32 [mscorlib]System.ArgIterator::GetRemainingCount ()
34 call instance typedref [mscorlib]System.ArgIterator::GetNextArg ()
35 call object [mscorlib]System.TypedReference::ToObject (typedref)
36 call void [mscorlib]System.Console::WriteLine (object)
43 .method public static int32 test_0_varargs () cil managed {
48 call vararg void Tests::varargtest (..., int32, int32)
53 .method public static vararg int32 varargtest_refany () cil managed {
56 valuetype [mscorlib]System.ArgIterator it,
62 call instance void [mscorlib]System.ArgIterator::.ctor (valuetype [mscorlib]System.RuntimeArgumentHandle)
67 call instance int32 [mscorlib]System.ArgIterator::GetRemainingCount ()
72 call instance typedref [mscorlib]System.ArgIterator::GetNextArg ()
74 call void [mscorlib]System.Console::WriteLine (int32)
78 call void [mscorlib]System.Console::WriteLine (int32)
89 .method public static int32 test_85_varargs_refany () cil managed {
94 call vararg int32 Tests::varargtest_refany (..., int32, int32)
98 .method public static int32 test_0_refanytest () cil managed {
109 // Test refany with valid type
116 // Test refany with invalid type
123 catch [mscorlib]System.InvalidCastException {
132 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle (valuetype [mscorlib]System.RuntimeTypeHandle)
134 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle (valuetype [mscorlib]System.RuntimeTypeHandle)
151 .method public static int32 Main () cil managed {
156 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
157 call int32 class [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type)