diff --git a/src/coreclr/tests/src/JIT/Directed/IL/PInvokeTail/PInvokeTail.il b/src/coreclr/tests/src/JIT/Directed/IL/PInvokeTail/PInvokeTail.il index 4fd1840cde096..b9eb324067003 100644 --- a/src/coreclr/tests/src/JIT/Directed/IL/PInvokeTail/PInvokeTail.il +++ b/src/coreclr/tests/src/JIT/Directed/IL/PInvokeTail/PInvokeTail.il @@ -13,7 +13,6 @@ { } - .class public auto ansi Wrapper { .method public static pinvokeimpl("msvcrt.dll" cdecl) int32 puts(int8* A_0) il managed preservesig{ } @@ -28,78 +27,65 @@ } // end of class 'Wrapper' -.method public static int32 ?callputs1@@YAHXZ() il managed +.method public static pinvokeimpl("msvcrt.dll" cdecl) int32 puts(int8* A_0) il managed preservesig{ } + +.method public static int32 callputs1(char&) il managed { - .maxstack 1 + .maxstack 1 - IL_0000: ldstr bytearray(48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 00 00) //ldptr D_00003000 - IL_0005: tail. call int32 puts(int8*) - IL_000a: ret -} // end of global method '?callputs1@@YAHXZ' + ldarg.0 + conv.i + tail. call int32 puts(int8*) + ret +} // end of global method 'callputs1' -.method public static int32 ?callputs2@@YAHXZ() il managed +.method public static int32 callputs2(char&) il managed { - .maxstack 1 + .maxstack 1 - IL_0000: ldstr bytearray(48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 00 00) //" " //ldptr D_00003010 - IL_0005: tail. call int32 Wrapper::puts(int8*) - IL_000a: ret -} // end of global method '?callputs2@@YAHXZ' + ldarg.0 + conv.i + tail. call int32 Wrapper::puts(int8*) + ret +} // end of global method 'callputs2' .method public static int32 main() il managed { - .entrypoint - .maxstack 2 - - IL_0000: call int32 ?callputs1@@YAHXZ() - IL_0005: ldc.i4 0x0 - IL_000a: bge IL_0029 - - IL_000f: call class [mscorlib]System.IO.TextWriter [System.Console]System.Console::get_Out() - IL_0014: ldstr "Puts Failed" //ldptr D_00003020 - IL_0019: //newobj instance void [mscorlib]System.String::.ctor(wchar*) - IL_001e: callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) - IL_0023: ldc.i4 0x1 - IL_0028: ret - - IL_0029: call int32 ?callputs2@@YAHXZ() - IL_002e: ldc.i4 0x0 - IL_0033: bge IL_0052 - - IL_0038: call class [mscorlib]System.IO.TextWriter [System.Console]System.Console::get_Out() - IL_003d: ldstr "wrapper: Puts failed"//ldptr D_00003040 - IL_0042: //newobj instance void [mscorlib]System.String::.ctor(wchar*) - IL_0047: callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) - IL_004c: ldc.i4 0x1 - IL_0051: ret - - IL_0052: call class [mscorlib]System.IO.TextWriter [System.Console]System.Console::get_Out() - IL_0057: ldstr "passed"//ldptr D_00003070 - IL_005c: //newobj instance void [mscorlib]System.String::.ctor(wchar*) - IL_0061: callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) - IL_0066: ldc.i4 0x64 - IL_006b: ret + .entrypoint + .maxstack 4 + .locals init (char& pinned) + + ldstr bytearray(48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 00 00) // "Hello World!" + call instance char& modreq([mscorlib]System.Runtime.InteropServices.InAttribute) [mscorlib]System.String::GetPinnableReference() + stloc.0 + + ldloc.0 + call int32 callputs1(char&) + ldc.i4 0x0 + bge PASS_1 + + call class [mscorlib]System.IO.TextWriter [System.Console]System.Console::get_Out() + ldstr "puts() failed" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldc.i4 0x1 + ret + + PASS_1: + ldloc.0 + call int32 callputs2(char&) + ldc.i4 0x0 + bge PASS_2 + + call class [mscorlib]System.IO.TextWriter [System.Console]System.Console::get_Out() + ldstr "puts() failed" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldc.i4 0x1 + ret + + PASS_2: + call class [mscorlib]System.IO.TextWriter [System.Console]System.Console::get_Out() + ldstr "Passed" + callvirt instance void [mscorlib]System.IO.TextWriter::WriteLine(string) + ldc.i4 0x64 + ret } // end of global method 'main' - -.method public static int32 _mainMSIL(int32 argc,int8** argv,int8** envp) il managed -{ - .maxstack 1 - - IL_0000: tail. call int32 main() - IL_0005: ret -} // end of global method '_mainMSIL' - -.method public static pinvokeimpl("msvcrt.dll" cdecl) int32 puts(int8* A_0) il managed preservesig{ } -.data D_00003000 = bytearray ( - 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 00 00) // Hello World!.... -.data D_00003010 = bytearray ( - 48 65 6C 6C 6F 20 57 6F 72 6C 64 21 00 00 00 00) // Hello World!.... -.data D_00003020 = bytearray ( - 70 00 75 00 74 00 73 00 28 00 29 00 20 00 66 00 // p.u.t.s.(.). .f. - 61 00 69 00 6C 00 65 00 64 00 2E 00 00 00 00 00) // a.i.l.e.d....... -.data D_00003040 = bytearray ( - 57 00 72 00 61 00 70 00 70 00 65 00 72 00 3A 00 // W.r.a.p.p.e.r.:. - 3A 00 70 00 75 00 74 00 73 00 28 00 29 00 20 00 // :.p.u.t.s.(.). . - 66 00 61 00 69 00 6C 00 65 00 64 00 2E 00 00 00) // f.a.i.l.e.d..... -.data D_00003070 = bytearray ( - 50 00 61 00 73 00 73 00 65 00 64 00 00 00) // P.a.s.s.e.d... diff --git a/src/coreclr/tests/src/JIT/Directed/pinning/object-pin/Object-Pin.il b/src/coreclr/tests/src/JIT/Directed/pinning/object-pin/Object-Pin.il index 6b4ab09bc545d..b3a54f21cfe1c 100644 --- a/src/coreclr/tests/src/JIT/Directed/pinning/object-pin/Object-Pin.il +++ b/src/coreclr/tests/src/JIT/Directed/pinning/object-pin/Object-Pin.il @@ -140,6 +140,7 @@ FAILURE3: stloc.1 ldloc 1 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) stloc 3 @@ -148,6 +149,7 @@ FAILURE3: stloc.2 ldloc 2 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) stloc 4 @@ -158,6 +160,7 @@ FAILURE3: call void [mscorlib]System.GC::Collect() ldloc 1 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) ldloc 3 conv.i @@ -165,6 +168,7 @@ FAILURE3: SOFT2: ldloc 2 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) ldloc 4 conv.i @@ -202,6 +206,7 @@ AA_3: stloc.1 ldloc 1 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) stloc 3 @@ -210,6 +215,7 @@ AA_3: stloc.2 ldloc 2 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) stloc 4 @@ -220,6 +226,7 @@ AA_3: call void [mscorlib]System.GC::Collect() ldloc 1 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) ldloc 3 conv.i @@ -227,6 +234,7 @@ AA_3: SOFT4: ldloc 2 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) ldloc 4 conv.i @@ -263,6 +271,7 @@ AA_3: stloc.1 ldloc 1 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) stloc 3 @@ -271,6 +280,7 @@ AA_3: stloc.2 ldloc 2 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) stloc 4 @@ -285,7 +295,8 @@ AA_3: ldloc 5 stfld int32 Consume::yucko - ldloc 2 + ldloc 2 + conv.i ldflda int32 Consume::yucko ldc.i4 66 call void Pin1_Test::Set_Val(void*,int32) @@ -301,7 +312,8 @@ Yippie1: ldloc 5 stfld int32 Consume::yucko - ldloc 2 + ldloc 2 + conv.i ldflda int32 Consume::yucko ldc.i4 88 call void Pin1_Test::Set_Val(void*,int32) @@ -314,6 +326,7 @@ Yippie1: Yippie2: call void [mscorlib]System.GC::Collect() ldloc 1 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) ldloc 3 conv.i @@ -321,6 +334,7 @@ Yippie2: SOFT5: ldloc 2 + conv.i call int32 Pin1_Test::Ret_Ptr(void*) ldloc 4 conv.i