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 (int32 last) 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 {
95 call vararg int32 Tests::varargtest_refany (int32, ..., int32, int32)
100 .method public static int32 test_0_varargs_refany_noargs () cil managed {
104 call vararg int32 Tests::varargtest_refany (int32)
108 .method public static int32 test_0_refanytest () cil managed {
119 // Test refany with valid type
126 // Test refany with invalid type
133 catch [mscorlib]System.InvalidCastException {
142 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle (valuetype [mscorlib]System.RuntimeTypeHandle)
144 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle (valuetype [mscorlib]System.RuntimeTypeHandle)
161 .method public static int32 Main () cil managed {
166 call class [mscorlib]System.Type class [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
167 call int32 class [TestDriver]TestDriver::RunTests(class [mscorlib]System.Type)