From ebfe93ea754ab763220a56a827bf62a5d96a1f65 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 15:50:24 +0000 Subject: [PATCH 1/6] Initial plan From 63fc0901b3874c53b57c71934ffdd775e8663425 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 16:21:29 +0000 Subject: [PATCH 2/6] Add tracking for pinned locals in TailCallChecks (WIP) Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx | 1416 +++++++++++++++++ .../_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx | 45 + .../_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx | 45 + .../_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx | 856 ++++++++++ src/Compiler/Checking/TailCallChecks.fs | 19 +- .../EmittedIL/TailCalls.fs | 27 + 6 files changed, 2407 insertions(+), 1 deletion(-) create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx new file mode 100644 index 00000000000..a66fbd8b862 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx @@ -0,0 +1,1416 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== +Name: '.method public static void run() cil managed' + +Expected: .maxstack 4 +Actual: .maxstack 6 +== + +== +Name: '.method public static void run() cil managed' + +Expected: int32& pinned V_1) +Actual: int32[] V_1, +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0000: ldc.i4.3 +Actual: int32& pinned V_2) +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0001: newarr [runtime]System.Int32 +Actual: IL_0000: ldc.i4.3 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0006: dup +Actual: IL_0001: newarr [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0007: ldc.i4.0 +Actual: IL_0006: dup +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0008: ldc.i4.1 +Actual: IL_0007: ldc.i4.0 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0009: stelem.i4 +Actual: IL_0008: ldc.i4.1 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_000a: dup +Actual: IL_0009: stelem [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_000b: ldc.i4.1 +Actual: IL_000e: dup +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_000c: ldc.i4.2 +Actual: IL_000f: ldc.i4.1 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_000d: stelem.i4 +Actual: IL_0010: ldc.i4.2 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_000e: dup +Actual: IL_0011: stelem [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_000f: ldc.i4.2 +Actual: IL_0016: dup +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0010: ldc.i4.3 +Actual: IL_0017: ldc.i4.2 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0011: stelem.i4 +Actual: IL_0018: ldc.i4.3 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0012: dup +Actual: IL_0019: stelem [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0013: brfalse.s IL_001c +Actual: IL_001e: stloc.1 +== + +== +Name: '.method public static void run() cil managed' + +Expected: +Actual: IL_001f: ldloc.1 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0015: dup +Actual: IL_0020: brfalse.s IL_003c +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0016: ldc.i4.0 +Actual: +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0017: ldelema [runtime]System.Int32 +Actual: IL_0022: ldloc.1 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_001c: stloc.1 +Actual: IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_001d: ldloc.1 +Actual: IL_0028: brfalse.s IL_0037 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_001e: conv.i +Actual: +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_001f: stloc.0 +Actual: IL_002a: ldloc.1 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0020: ldc.i4.s 42 +Actual: IL_002b: ldc.i4.0 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0022: ldc.i4.5 +Actual: IL_002c: ldelema [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0023: call void TailCall06::foo<int32>(int32, +Actual: IL_0031: stloc.2 +== + +== +Name: '.method public static void run() cil managed' + +Expected: !!0) +Actual: IL_0032: ldloc.2 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0028: nop +Actual: IL_0033: conv.i +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0029: ldc.i4.0 +Actual: IL_0034: nop +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_002a: conv.i +Actual: IL_0035: br.s IL_003f +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_002b: stloc.1 +Actual: +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_002c: ret +Actual: IL_0037: ldc.i4.0 +== + +== +Name: '.method public static void run() cil managed' + +Expected: } +Actual: IL_0038: conv.i +== + +\Expected: +.method public static void run() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + int32& pinned V_1) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stelem.i4 + IL_000a: dup + IL_000b: ldc.i4.1 + IL_000c: ldc.i4.2 + IL_000d: stelem.i4 + IL_000e: dup + IL_000f: ldc.i4.2 + IL_0010: ldc.i4.3 + IL_0011: stelem.i4 + IL_0012: dup + IL_0013: brfalse.s IL_001c + + IL_0015: dup + IL_0016: ldc.i4.0 + IL_0017: ldelema [runtime]System.Int32 + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: conv.i + IL_001f: stloc.0 + IL_0020: ldc.i4.s 42 + IL_0022: ldc.i4.5 + IL_0023: call void TailCall06::foo<int32>(int32, + !!0) + IL_0028: nop + IL_0029: ldc.i4.0 + IL_002a: conv.i + IL_002b: stloc.1 + IL_002c: ret + } + + + +Actual: +.method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stelem [runtime]System.Int32 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldc.i4.2 + IL_0011: stelem [runtime]System.Int32 + IL_0016: dup + IL_0017: ldc.i4.2 + IL_0018: ldc.i4.3 + IL_0019: stelem [runtime]System.Int32 + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: brfalse.s IL_003c + + IL_0022: ldloc.1 + IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) + IL_0028: brfalse.s IL_0037 + + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: ldelema [runtime]System.Int32 + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: conv.i + IL_0034: nop + IL_0035: br.s IL_003f + + IL_0037: ldc.i4.0 + IL_0038: conv.i + + +Entire actual: + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly 'assembly' +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module 'assembly.dll' + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed TailCall06 + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static void foo<a>(int32 x, + !!a y) cil managed + { + + .maxstack 8 + IL_0000: ldstr "%d" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0015: pop + IL_0016: ret + } + + .method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stelem [runtime]System.Int32 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldc.i4.2 + IL_0011: stelem [runtime]System.Int32 + IL_0016: dup + IL_0017: ldc.i4.2 + IL_0018: ldc.i4.3 + IL_0019: stelem [runtime]System.Int32 + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: brfalse.s IL_003c + + IL_0022: ldloc.1 + IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) + IL_0028: brfalse.s IL_0037 + + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: ldelema [runtime]System.Int32 + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: conv.i + IL_0034: nop + IL_0035: br.s IL_003f + + IL_0037: ldc.i4.0 + IL_0038: conv.i + IL_0039: nop + IL_003a: br.s IL_003f + + IL_003c: ldc.i4.0 + IL_003d: conv.i + IL_003e: nop + IL_003f: stloc.0 + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: tail. + IL_0045: call void TailCall06::foo<int32>(int32, + !!0) + IL_004a: ret + } + +} + +.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 + extends [runtime]System.Object +{ +} + + + + + + + at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 + at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 + at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) + at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 + at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) + at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + + + + + + + + + + + + Determining projects to restore... + Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/1b0a3d90-0de5-4313-b60e-54e70cbf18ea.tmp/ProjectFile.fsproj (in 98 ms). +/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/1b0a3d90-0de5-4313-b60e-54e70cbf18ea.tmp/ProjectFile.fsproj] + ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/1b0a3d90-0de5-4313-b60e-54e70cbf18ea.tmp/bin/Debug/net10.0/ProjectFile.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.52 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.09] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.10] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: .maxstack 4 +[xUnit.net 00:00:11.23] Actual: .maxstack 6 +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: int32& pinned V_1) +[xUnit.net 00:00:11.23] Actual: int32[] V_1, +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_0000: ldc.i4.3 +[xUnit.net 00:00:11.23] Actual: int32& pinned V_2) +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:11.23] Actual: IL_0000: ldc.i4.3 +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_0006: dup +[xUnit.net 00:00:11.23] Actual: IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_0007: ldc.i4.0 +[xUnit.net 00:00:11.23] Actual: IL_0006: dup +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_0008: ldc.i4.1 +[xUnit.net 00:00:11.23] Actual: IL_0007: ldc.i4.0 +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_0009: stelem.i4 +[xUnit.net 00:00:11.23] Actual: IL_0008: ldc.i4.1 +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_000a: dup +[xUnit.net 00:00:11.23] Actual: IL_0009: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.23] +[xUnit.net 00:00:11.23] Expected: IL_000b: ldc.i4.1 +[xUnit.net 00:00:11.23] Actual: IL_000e: dup +[xUnit.net 00:00:11.23] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_000c: ldc.i4.2 +[xUnit.net 00:00:11.28] Actual: IL_000f: ldc.i4.1 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_000d: stelem.i4 +[xUnit.net 00:00:11.28] Actual: IL_0010: ldc.i4.2 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_000e: dup +[xUnit.net 00:00:11.28] Actual: IL_0011: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_000f: ldc.i4.2 +[xUnit.net 00:00:11.28] Actual: IL_0016: dup +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_0010: ldc.i4.3 +[xUnit.net 00:00:11.28] Actual: IL_0017: ldc.i4.2 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_0011: stelem.i4 +[xUnit.net 00:00:11.28] Actual: IL_0018: ldc.i4.3 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_0012: dup +[xUnit.net 00:00:11.28] Actual: IL_0019: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_0013: brfalse.s IL_001c +[xUnit.net 00:00:11.28] Actual: IL_001e: stloc.1 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: +[xUnit.net 00:00:11.28] Actual: IL_001f: ldloc.1 +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] == +[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.28] +[xUnit.net 00:00:11.28] Expected: IL_0015: dup +[xUnit.net 00:00:11.29] Actual: IL_0020: brfalse.s IL_003c +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0016: ldc.i4.0 +[xUnit.net 00:00:11.29] Actual: +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0017: ldelema [runtime]System.Int32 +[xUnit.net 00:00:11.29] Actual: IL_0022: ldloc.1 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_001c: stloc.1 +[xUnit.net 00:00:11.29] Actual: IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_001d: ldloc.1 +[xUnit.net 00:00:11.29] Actual: IL_0028: brfalse.s IL_0037 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_001e: conv.i +[xUnit.net 00:00:11.29] Actual: +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_001f: stloc.0 +[xUnit.net 00:00:11.29] Actual: IL_002a: ldloc.1 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0020: ldc.i4.s 42 +[xUnit.net 00:00:11.29] Actual: IL_002b: ldc.i4.0 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0022: ldc.i4.5 +[xUnit.net 00:00:11.29] Actual: IL_002c: ldelema [runtime]System.Int32 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0023: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:11.29] Actual: IL_0031: stloc.2 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: !!0) +[xUnit.net 00:00:11.29] Actual: IL_0032: ldloc.2 +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0028: nop +[xUnit.net 00:00:11.29] Actual: IL_0033: conv.i +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_0029: ldc.i4.0 +[xUnit.net 00:00:11.29] Actual: IL_0034: nop +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] Expected: IL_002a: conv.i +[xUnit.net 00:00:11.29] Actual: IL_0035: br.s IL_003f +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.29] == +[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.29] +[xUnit.net 00:00:11.30] Expected: IL_002b: stloc.1 +[xUnit.net 00:00:11.30] Actual: +[xUnit.net 00:00:11.30] == +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] == +[xUnit.net 00:00:11.30] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] Expected: IL_002c: ret +[xUnit.net 00:00:11.30] Actual: IL_0037: ldc.i4.0 +[xUnit.net 00:00:11.30] == +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] == +[xUnit.net 00:00:11.30] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] Expected: } +[xUnit.net 00:00:11.30] Actual: IL_0038: conv.i +[xUnit.net 00:00:11.30] == +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] \Expected: +[xUnit.net 00:00:11.30] .method public static void run() cil managed +[xUnit.net 00:00:11.30] { +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] .maxstack 4 +[xUnit.net 00:00:11.30] .locals init (native int V_0, +[xUnit.net 00:00:11.30] int32& pinned V_1) +[xUnit.net 00:00:11.30] IL_0000: ldc.i4.3 +[xUnit.net 00:00:11.30] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:11.30] IL_0006: dup +[xUnit.net 00:00:11.30] IL_0007: ldc.i4.0 +[xUnit.net 00:00:11.30] IL_0008: ldc.i4.1 +[xUnit.net 00:00:11.30] IL_0009: stelem.i4 +[xUnit.net 00:00:11.30] IL_000a: dup +[xUnit.net 00:00:11.30] IL_000b: ldc.i4.1 +[xUnit.net 00:00:11.30] IL_000c: ldc.i4.2 +[xUnit.net 00:00:11.30] IL_000d: stelem.i4 +[xUnit.net 00:00:11.30] IL_000e: dup +[xUnit.net 00:00:11.30] IL_000f: ldc.i4.2 +[xUnit.net 00:00:11.30] IL_0010: ldc.i4.3 +[xUnit.net 00:00:11.30] IL_0011: stelem.i4 +[xUnit.net 00:00:11.30] IL_0012: dup +[xUnit.net 00:00:11.30] IL_0013: brfalse.s IL_001c +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] IL_0015: dup +[xUnit.net 00:00:11.30] IL_0016: ldc.i4.0 +[xUnit.net 00:00:11.30] IL_0017: ldelema [runtime]System.Int32 +[xUnit.net 00:00:11.30] IL_001c: stloc.1 +[xUnit.net 00:00:11.30] IL_001d: ldloc.1 +[xUnit.net 00:00:11.30] IL_001e: conv.i +[xUnit.net 00:00:11.30] IL_001f: stloc.0 +[xUnit.net 00:00:11.30] IL_0020: ldc.i4.s 42 +[xUnit.net 00:00:11.30] IL_0022: ldc.i4.5 +[xUnit.net 00:00:11.30] IL_0023: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:11.30] !!0) +[xUnit.net 00:00:11.30] IL_0028: nop +[xUnit.net 00:00:11.30] IL_0029: ldc.i4.0 +[xUnit.net 00:00:11.30] IL_002a: conv.i +[xUnit.net 00:00:11.30] IL_002b: stloc.1 +[xUnit.net 00:00:11.30] IL_002c: ret +[xUnit.net 00:00:11.30] } +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] Actual: +[xUnit.net 00:00:11.30] .method public static void run() cil managed +[xUnit.net 00:00:11.30] { +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] .maxstack 6 +[xUnit.net 00:00:11.30] .locals init (native int V_0, +[xUnit.net 00:00:11.30] int32[] V_1, +[xUnit.net 00:00:11.30] int32& pinned V_2) +[xUnit.net 00:00:11.30] IL_0000: ldc.i4.3 +[xUnit.net 00:00:11.30] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:11.30] IL_0006: dup +[xUnit.net 00:00:11.30] IL_0007: ldc.i4.0 +[xUnit.net 00:00:11.30] IL_0008: ldc.i4.1 +[xUnit.net 00:00:11.30] IL_0009: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.30] IL_000e: dup +[xUnit.net 00:00:11.30] IL_000f: ldc.i4.1 +[xUnit.net 00:00:11.30] IL_0010: ldc.i4.2 +[xUnit.net 00:00:11.30] IL_0011: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.30] IL_0016: dup +[xUnit.net 00:00:11.30] IL_0017: ldc.i4.2 +[xUnit.net 00:00:11.30] IL_0018: ldc.i4.3 +[xUnit.net 00:00:11.30] IL_0019: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.30] IL_001e: stloc.1 +[xUnit.net 00:00:11.30] IL_001f: ldloc.1 +[xUnit.net 00:00:11.30] IL_0020: brfalse.s IL_003c +[xUnit.net 00:00:11.30] +[xUnit.net 00:00:11.30] IL_0022: ldloc.1 +[xUnit.net 00:00:11.31] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +[xUnit.net 00:00:11.31] IL_0028: brfalse.s IL_0037 +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] IL_002a: ldloc.1 +[xUnit.net 00:00:11.31] IL_002b: ldc.i4.0 +[xUnit.net 00:00:11.31] IL_002c: ldelema [runtime]System.Int32 +[xUnit.net 00:00:11.31] IL_0031: stloc.2 +[xUnit.net 00:00:11.31] IL_0032: ldloc.2 +[xUnit.net 00:00:11.31] IL_0033: conv.i +[xUnit.net 00:00:11.31] IL_0034: nop +[xUnit.net 00:00:11.31] IL_0035: br.s IL_003f +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] IL_0037: ldc.i4.0 +[xUnit.net 00:00:11.31] IL_0038: conv.i +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] Entire actual: +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] .assembly extern runtime { } +[xUnit.net 00:00:11.31] .assembly extern FSharp.Core { } +[xUnit.net 00:00:11.31] .assembly 'assembly' +[xUnit.net 00:00:11.31] { +[xUnit.net 00:00:11.31] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, +[xUnit.net 00:00:11.31] int32, +[xUnit.net 00:00:11.31] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] .hash algorithm 0x00008004 +[xUnit.net 00:00:11.31] .ver 0:0:0:0 +[xUnit.net 00:00:11.31] } +[xUnit.net 00:00:11.31] .module 'assembly.dll' +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] .imagebase {value} +[xUnit.net 00:00:11.31] .file alignment 0x00000200 +[xUnit.net 00:00:11.31] .stackreserve 0x00100000 +[xUnit.net 00:00:11.31] .subsystem 0x0003 +[xUnit.net 00:00:11.31] .corflags 0x00000001 +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.31] +[xUnit.net 00:00:11.32] +[xUnit.net 00:00:11.32] +[xUnit.net 00:00:11.32] +[xUnit.net 00:00:11.32] .class public abstract auto ansi sealed TailCall06 +[xUnit.net 00:00:11.32] extends [runtime]System.Object +[xUnit.net 00:00:11.32] { +[xUnit.net 00:00:11.32] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) +[xUnit.net 00:00:11.32] .method public static void foo<a>(int32 x, +[xUnit.net 00:00:11.32] !!a y) cil managed +[xUnit.net 00:00:11.32] { +[xUnit.net 00:00:11.32] +[xUnit.net 00:00:11.32] .maxstack 8 +[xUnit.net 00:00:11.32] IL_0000: ldstr "%d" +[xUnit.net 00:00:11.32] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) +[xUnit.net 00:00:11.32] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) +[xUnit.net 00:00:11.32] IL_000f: ldarg.0 +[xUnit.net 00:00:11.32] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) +[xUnit.net 00:00:11.32] IL_0015: pop +[xUnit.net 00:00:11.32] IL_0016: ret +[xUnit.net 00:00:11.32] } +[xUnit.net 00:00:11.32] +[xUnit.net 00:00:11.32] .method public static void run() cil managed +[xUnit.net 00:00:11.32] { +[xUnit.net 00:00:11.32] +[xUnit.net 00:00:11.32] .maxstack 6 +[xUnit.net 00:00:11.32] .locals init (native int V_0, +[xUnit.net 00:00:11.32] int32[] V_1, +[xUnit.net 00:00:11.32] int32& pinned V_2) +[xUnit.net 00:00:11.32] IL_0000: ldc.i4.3 +[xUnit.net 00:00:11.32] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:11.32] IL_0006: dup +[xUnit.net 00:00:11.32] IL_0007: ldc.i4.0 +[xUnit.net 00:00:11.32] IL_0008: ldc.i4.1 +[xUnit.net 00:00:11.32] IL_0009: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.32] IL_000e: dup +[xUnit.net 00:00:11.32] IL_000f: ldc.i4.1 +[xUnit.net 00:00:11.32] IL_0010: ldc.i4.2 +[xUnit.net 00:00:11.33] IL_0011: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.33] IL_0016: dup +[xUnit.net 00:00:11.33] IL_0017: ldc.i4.2 +[xUnit.net 00:00:11.33] IL_0018: ldc.i4.3 +[xUnit.net 00:00:11.33] IL_0019: stelem [runtime]System.Int32 +[xUnit.net 00:00:11.33] IL_001e: stloc.1 +[xUnit.net 00:00:11.33] IL_001f: ldloc.1 +[xUnit.net 00:00:11.33] IL_0020: brfalse.s IL_003c +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] IL_0022: ldloc.1 +[xUnit.net 00:00:11.33] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +[xUnit.net 00:00:11.33] IL_0028: brfalse.s IL_0037 +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] IL_002a: ldloc.1 +[xUnit.net 00:00:11.33] IL_002b: ldc.i4.0 +[xUnit.net 00:00:11.33] IL_002c: ldelema [runtime]System.Int32 +[xUnit.net 00:00:11.33] IL_0031: stloc.2 +[xUnit.net 00:00:11.33] IL_0032: ldloc.2 +[xUnit.net 00:00:11.33] IL_0033: conv.i +[xUnit.net 00:00:11.33] IL_0034: nop +[xUnit.net 00:00:11.33] IL_0035: br.s IL_003f +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] IL_0037: ldc.i4.0 +[xUnit.net 00:00:11.33] IL_0038: conv.i +[xUnit.net 00:00:11.33] IL_0039: nop +[xUnit.net 00:00:11.33] IL_003a: br.s IL_003f +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] IL_003c: ldc.i4.0 +[xUnit.net 00:00:11.33] IL_003d: conv.i +[xUnit.net 00:00:11.33] IL_003e: nop +[xUnit.net 00:00:11.33] IL_003f: stloc.0 +[xUnit.net 00:00:11.33] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:11.33] IL_0042: ldc.i4.5 +[xUnit.net 00:00:11.33] IL_0043: tail. +[xUnit.net 00:00:11.33] IL_0045: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:11.33] !!0) +[xUnit.net 00:00:11.33] IL_004a: ret +[xUnit.net 00:00:11.33] } +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] } +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 +[xUnit.net 00:00:11.33] extends [runtime]System.Object +[xUnit.net 00:00:11.33] { +[xUnit.net 00:00:11.33] } +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] +[xUnit.net 00:00:11.33] Stack Trace: +[xUnit.net 00:00:11.33] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:11.33] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:11.33] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:11.33] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() +[xUnit.net 00:00:11.33] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) +[xUnit.net 00:00:11.33] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +[xUnit.net 00:00:16.49] Finished: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:11.22] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] + + + + \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx new file mode 100644 index 00000000000..9989a2dcf28 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.11] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.12] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.14] Finished: FSharp.Compiler.ComponentTests + + + + + No test matches the given testcase filter `FullyQualifiedName~'TailCall 06'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx new file mode 100644 index 00000000000..dbe71b9e14e --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.17] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.17] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.18] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.19] Finished: FSharp.Compiler.ComponentTests + + + + + No test matches the given testcase filter `FullyQualifiedName~TailCall06` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx new file mode 100644 index 00000000000..22494d7fa2f --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx @@ -0,0 +1,856 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determining projects to restore... + Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/eb25d901-6cea-4057-b4dc-c64a6f55ed2c.tmp/ProjectFile.fsproj (in 83 ms). +/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/eb25d901-6cea-4057-b4dc-c64a6f55ed2c.tmp/ProjectFile.fsproj] + ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/eb25d901-6cea-4057-b4dc-c64a6f55ed2c.tmp/bin/Debug/net10.0/ProjectFile.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.47 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0040: ldc.i4.s 42 +Actual: IL_0000: ldc.i4.3 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0042: ldc.i4.5 +Actual: IL_0001: newarr [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0043: call void TailCall06::foo<int32>(int32, +Actual: IL_0006: dup +== + +== +Name: '.method public static void run() cil managed' + +Expected: !!0) +Actual: IL_0007: ldc.i4.0 +== + +\Expected: +.method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: call void TailCall06::foo<int32>(int32, + !!0) + + + +Actual: +.method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + + +Entire actual: + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.dll + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed TailCall06 + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static void foo<a>(int32 x, + !!a y) cil managed + { + + .maxstack 8 + IL_0000: ldstr "%d" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0015: pop + IL_0016: ret + } + + .method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stelem [runtime]System.Int32 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldc.i4.2 + IL_0011: stelem [runtime]System.Int32 + IL_0016: dup + IL_0017: ldc.i4.2 + IL_0018: ldc.i4.3 + IL_0019: stelem [runtime]System.Int32 + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: brfalse.s IL_003c + + IL_0022: ldloc.1 + IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) + IL_0028: brfalse.s IL_0037 + + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: ldelema [runtime]System.Int32 + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: conv.i + IL_0034: nop + IL_0035: br.s IL_003f + + IL_0037: ldc.i4.0 + IL_0038: conv.i + IL_0039: nop + IL_003a: br.s IL_003f + + IL_003c: ldc.i4.0 + IL_003d: conv.i + IL_003e: nop + IL_003f: stloc.0 + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: tail. + IL_0045: call void TailCall06::foo<int32>(int32, + !!0) + IL_004a: ret + } + +} + +.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 + extends [runtime]System.Object +{ +} + + + + + + + at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 + at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 + at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) + at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 + at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) + at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) + at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) + at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.20] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.21] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:14.97] +[xUnit.net 00:00:14.97] == +[xUnit.net 00:00:14.97] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:14.97] +[xUnit.net 00:00:14.97] Expected: IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:14.97] Actual: IL_0000: ldc.i4.3 +[xUnit.net 00:00:14.97] == +[xUnit.net 00:00:14.97] +[xUnit.net 00:00:14.97] == +[xUnit.net 00:00:14.97] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:14.97] +[xUnit.net 00:00:14.97] Expected: IL_0042: ldc.i4.5 +[xUnit.net 00:00:14.97] Actual: IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:14.97] == +[xUnit.net 00:00:14.97] +[xUnit.net 00:00:14.98] == +[xUnit.net 00:00:14.98] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] Expected: IL_0043: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:14.98] Actual: IL_0006: dup +[xUnit.net 00:00:14.98] == +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] == +[xUnit.net 00:00:14.98] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] Expected: !!0) +[xUnit.net 00:00:14.98] Actual: IL_0007: ldc.i4.0 +[xUnit.net 00:00:14.98] == +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] \Expected: +[xUnit.net 00:00:14.98] .method public static void run() cil managed +[xUnit.net 00:00:14.98] { +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] .maxstack 6 +[xUnit.net 00:00:14.98] .locals init (native int V_0, +[xUnit.net 00:00:14.98] int32[] V_1, +[xUnit.net 00:00:14.98] int32& pinned V_2) +[xUnit.net 00:00:14.98] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:14.98] IL_0042: ldc.i4.5 +[xUnit.net 00:00:14.98] IL_0043: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:14.98] !!0) +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] Actual: +[xUnit.net 00:00:14.98] .method public static void run() cil managed +[xUnit.net 00:00:14.98] { +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] .maxstack 6 +[xUnit.net 00:00:14.98] .locals init (native int V_0, +[xUnit.net 00:00:14.98] int32[] V_1, +[xUnit.net 00:00:14.98] int32& pinned V_2) +[xUnit.net 00:00:14.98] IL_0000: ldc.i4.3 +[xUnit.net 00:00:14.98] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:14.98] IL_0006: dup +[xUnit.net 00:00:14.98] IL_0007: ldc.i4.0 +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] Entire actual: +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] .assembly extern runtime { } +[xUnit.net 00:00:14.98] .assembly extern FSharp.Core { } +[xUnit.net 00:00:14.98] .assembly assembly +[xUnit.net 00:00:14.98] { +[xUnit.net 00:00:14.98] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, +[xUnit.net 00:00:14.98] int32, +[xUnit.net 00:00:14.98] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] .hash algorithm 0x00008004 +[xUnit.net 00:00:14.98] .ver 0:0:0:0 +[xUnit.net 00:00:14.98] } +[xUnit.net 00:00:14.98] .module assembly.dll +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] .imagebase {value} +[xUnit.net 00:00:14.98] .file alignment 0x00000200 +[xUnit.net 00:00:14.98] .stackreserve 0x00100000 +[xUnit.net 00:00:14.98] .subsystem 0x0003 +[xUnit.net 00:00:14.98] .corflags 0x00000001 +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] +[xUnit.net 00:00:14.98] .class public abstract auto ansi sealed TailCall06 +[xUnit.net 00:00:14.98] extends [runtime]System.Object +[xUnit.net 00:00:14.98] { +[xUnit.net 00:00:14.98] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) +[xUnit.net 00:00:14.98] .method public static void foo<a>(int32 x, +[xUnit.net 00:00:14.98] !!a y) cil managed +[xUnit.net 00:00:14.99] { +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] .maxstack 8 +[xUnit.net 00:00:14.99] IL_0000: ldstr "%d" +[xUnit.net 00:00:14.99] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) +[xUnit.net 00:00:14.99] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) +[xUnit.net 00:00:14.99] IL_000f: ldarg.0 +[xUnit.net 00:00:14.99] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) +[xUnit.net 00:00:14.99] IL_0015: pop +[xUnit.net 00:00:14.99] IL_0016: ret +[xUnit.net 00:00:14.99] } +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] .method public static void run() cil managed +[xUnit.net 00:00:14.99] { +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] .maxstack 6 +[xUnit.net 00:00:14.99] .locals init (native int V_0, +[xUnit.net 00:00:14.99] int32[] V_1, +[xUnit.net 00:00:14.99] int32& pinned V_2) +[xUnit.net 00:00:14.99] IL_0000: ldc.i4.3 +[xUnit.net 00:00:14.99] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:14.99] IL_0006: dup +[xUnit.net 00:00:14.99] IL_0007: ldc.i4.0 +[xUnit.net 00:00:14.99] IL_0008: ldc.i4.1 +[xUnit.net 00:00:14.99] IL_0009: stelem [runtime]System.Int32 +[xUnit.net 00:00:14.99] IL_000e: dup +[xUnit.net 00:00:14.99] IL_000f: ldc.i4.1 +[xUnit.net 00:00:14.99] IL_0010: ldc.i4.2 +[xUnit.net 00:00:14.99] IL_0011: stelem [runtime]System.Int32 +[xUnit.net 00:00:14.99] IL_0016: dup +[xUnit.net 00:00:14.99] IL_0017: ldc.i4.2 +[xUnit.net 00:00:14.99] IL_0018: ldc.i4.3 +[xUnit.net 00:00:14.99] IL_0019: stelem [runtime]System.Int32 +[xUnit.net 00:00:14.99] IL_001e: stloc.1 +[xUnit.net 00:00:14.99] IL_001f: ldloc.1 +[xUnit.net 00:00:14.99] IL_0020: brfalse.s IL_003c +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] IL_0022: ldloc.1 +[xUnit.net 00:00:14.99] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +[xUnit.net 00:00:14.99] IL_0028: brfalse.s IL_0037 +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] IL_002a: ldloc.1 +[xUnit.net 00:00:14.99] IL_002b: ldc.i4.0 +[xUnit.net 00:00:14.99] IL_002c: ldelema [runtime]System.Int32 +[xUnit.net 00:00:14.99] IL_0031: stloc.2 +[xUnit.net 00:00:14.99] IL_0032: ldloc.2 +[xUnit.net 00:00:14.99] IL_0033: conv.i +[xUnit.net 00:00:14.99] IL_0034: nop +[xUnit.net 00:00:14.99] IL_0035: br.s IL_003f +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] IL_0037: ldc.i4.0 +[xUnit.net 00:00:14.99] IL_0038: conv.i +[xUnit.net 00:00:14.99] IL_0039: nop +[xUnit.net 00:00:14.99] IL_003a: br.s IL_003f +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] IL_003c: ldc.i4.0 +[xUnit.net 00:00:14.99] IL_003d: conv.i +[xUnit.net 00:00:14.99] IL_003e: nop +[xUnit.net 00:00:14.99] IL_003f: stloc.0 +[xUnit.net 00:00:14.99] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:14.99] IL_0042: ldc.i4.5 +[xUnit.net 00:00:14.99] IL_0043: tail. +[xUnit.net 00:00:14.99] IL_0045: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:14.99] !!0) +[xUnit.net 00:00:14.99] IL_004a: ret +[xUnit.net 00:00:14.99] } +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] } +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 +[xUnit.net 00:00:14.99] extends [runtime]System.Object +[xUnit.net 00:00:14.99] { +[xUnit.net 00:00:14.99] } +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] +[xUnit.net 00:00:14.99] Stack Trace: +[xUnit.net 00:00:14.99] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:14.99] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:14.99] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:14.99] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() +[xUnit.net 00:00:14.99] at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) +[xUnit.net 00:00:14.99] at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) +[xUnit.net 00:00:14.99] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) +[xUnit.net 00:00:14.99] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +[xUnit.net 00:00:16.50] Finished: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:14.96] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] + + + + \ No newline at end of file diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs index eba18dbeb4d..d6d7205d9ec 100644 --- a/src/Compiler/Checking/TailCallChecks.fs +++ b/src/Compiler/Checking/TailCallChecks.fs @@ -78,6 +78,9 @@ type cenv = /// Values in module that have been marked [] mustTailCall: Zset + + /// Indicates whether the current method has pinned locals that would prevent tail calls + hasPinnedLocals: bool } override x.ToString() = "" @@ -202,6 +205,7 @@ let CheckForNonTailRecCall (cenv: cenv) expr (tailCall: TailCall) = && not (IsValRefIsDllImport cenv.g vref) && not isCCall && not hasByrefArg + && not cenv.hasPinnedLocals noTailCallBlockers // blockers that will prevent the IL level from emitting a tail instruction else @@ -730,11 +734,23 @@ and CheckBinding cenv alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bind) : | Some info -> info | _ -> ValReprInfo.emptyValData + // Check if this binding introduces a pinned local + let cenv = + if v.IsFixed then + { cenv with hasPinnedLocals = true } + else + cenv + CheckLambdas isTop (Some v) cenv v.ShouldInline valReprInfo tailCall alwaysCheckNoReraise bindRhs v.Range v.Type ctxt and CheckBindings cenv binds = + let mutable currentCenv = cenv for bind in binds do - CheckBinding cenv false PermitByRefExpr.Yes bind + let (TBind(v, _, _)) = bind + // Update the environment if this binding is fixed + if v.IsFixed then + currentCenv <- { currentCenv with hasPinnedLocals = true } + CheckBinding currentCenv false PermitByRefExpr.Yes bind let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) = @@ -871,6 +887,7 @@ let CheckImplFile (g: TcGlobals, amap, reportErrors, implFileContents) = stackGuard = StackGuard(PostInferenceChecksStackGuardDepth, "CheckImplFile") amap = amap mustTailCall = Zset.empty valOrder + hasPinnedLocals = false } CheckDefnInModule cenv implFileContents diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs index 034ab15f37a..4151a5281e4 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs @@ -235,3 +235,30 @@ let run() = let mutable x = 0 in foo(&x,&x,5) """ ] + [] + let ``TailCall 06 - No tail call with pinned locals``() = + FSharp """ +module TailCall06 +let foo(x:int, y) = printfn "%d" x +let run() = + use ptr = fixed [| 1; 2; 3 |] + foo(42, 5) + """ + |> compileWithTailCalls + |> shouldSucceed + |> verifyIL [ + """ + .method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: call void TailCall06::foo(int32, + !!0) + """ + ] + From ce1a97f29e6b4de911a0088002a2a56b5563fbf7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 16:32:23 +0000 Subject: [PATCH 3/6] Add pinned locals tracking to IlxGen (still WIP - tail calls not blocked yet) Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx | 45 + .../_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx | 45 + .../_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx | 852 ++++++++++++++++++ .../_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx | 832 +++++++++++++++++ src/Compiler/CodeGen/IlxGen.fs | 12 +- .../EmittedIL/TailCalls.fs | 9 +- 6 files changed, 1787 insertions(+), 8 deletions(-) create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx new file mode 100644 index 00000000000..ca22e81e3d8 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.17] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.23] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.24] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.26] Finished: FSharp.Compiler.ComponentTests + + + + + No test matches the given testcase filter `FullyQualifiedName~'pinned locals'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx new file mode 100644 index 00000000000..59db8a4ba64 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.13] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.14] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.15] Finished: FSharp.Compiler.ComponentTests + + + + + No test matches the given testcase filter `FullyQualifiedName~'TailCall.*06'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx new file mode 100644 index 00000000000..12ead895859 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx @@ -0,0 +1,852 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determining projects to restore... + Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/d1f29c8c-1181-4fbc-b611-b8f893cb95dc.tmp/ProjectFile.fsproj (in 80 ms). +/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/d1f29c8c-1181-4fbc-b611-b8f893cb95dc.tmp/ProjectFile.fsproj] + ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/d1f29c8c-1181-4fbc-b611-b8f893cb95dc.tmp/bin/Debug/net10.0/ProjectFile.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.51 + + + + + + + + + + + + + + + + + + + + + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0040: ldc.i4.s 42 +Actual: IL_0000: ldc.i4.3 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0042: ldc.i4.5 +Actual: IL_0001: newarr [runtime]System.Int32 +== + +== +Name: '.method public static void run() cil managed' + +Expected: IL_0043: call void TailCall06::foo<int32>(int32, +Actual: IL_0006: dup +== + +== +Name: '.method public static void run() cil managed' + +Expected: !!0) +Actual: IL_0007: ldc.i4.0 +== + +\Expected: +.method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: call void TailCall06::foo<int32>(int32, + !!0) + + + +Actual: +.method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + + +Entire actual: + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly 'assembly' +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module 'assembly.dll' + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed TailCall06 + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static void foo<a>(int32 x, + !!a y) cil managed + { + + .maxstack 8 + IL_0000: ldstr "%d" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0015: pop + IL_0016: ret + } + + .method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stelem [runtime]System.Int32 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldc.i4.2 + IL_0011: stelem [runtime]System.Int32 + IL_0016: dup + IL_0017: ldc.i4.2 + IL_0018: ldc.i4.3 + IL_0019: stelem [runtime]System.Int32 + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: brfalse.s IL_003c + + IL_0022: ldloc.1 + IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) + IL_0028: brfalse.s IL_0037 + + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: ldelema [runtime]System.Int32 + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: conv.i + IL_0034: nop + IL_0035: br.s IL_003f + + IL_0037: ldc.i4.0 + IL_0038: conv.i + IL_0039: nop + IL_003a: br.s IL_003f + + IL_003c: ldc.i4.0 + IL_003d: conv.i + IL_003e: nop + IL_003f: stloc.0 + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: tail. + IL_0045: call void TailCall06::foo<int32>(int32, + !!0) + IL_004a: ret + } + +} + +.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 + extends [runtime]System.Object +{ +} + + + + + + + at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 + at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 + at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) + at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 + at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) + at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.14] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.16] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:09.47] +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] Expected: IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:09.48] Actual: IL_0000: ldc.i4.3 +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] Expected: IL_0042: ldc.i4.5 +[xUnit.net 00:00:09.48] Actual: IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] Expected: IL_0043: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.48] Actual: IL_0006: dup +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] Expected: !!0) +[xUnit.net 00:00:09.48] Actual: IL_0007: ldc.i4.0 +[xUnit.net 00:00:09.48] == +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] \Expected: +[xUnit.net 00:00:09.48] .method public static void run() cil managed +[xUnit.net 00:00:09.48] { +[xUnit.net 00:00:09.48] +[xUnit.net 00:00:09.48] .maxstack 6 +[xUnit.net 00:00:09.48] .locals init (native int V_0, +[xUnit.net 00:00:09.48] int32[] V_1, +[xUnit.net 00:00:09.48] int32& pinned V_2) +[xUnit.net 00:00:09.48] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:09.49] IL_0042: ldc.i4.5 +[xUnit.net 00:00:09.49] IL_0043: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.49] !!0) +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] Actual: +[xUnit.net 00:00:09.49] .method public static void run() cil managed +[xUnit.net 00:00:09.49] { +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .maxstack 6 +[xUnit.net 00:00:09.49] .locals init (native int V_0, +[xUnit.net 00:00:09.49] int32[] V_1, +[xUnit.net 00:00:09.49] int32& pinned V_2) +[xUnit.net 00:00:09.49] IL_0000: ldc.i4.3 +[xUnit.net 00:00:09.49] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:09.49] IL_0006: dup +[xUnit.net 00:00:09.49] IL_0007: ldc.i4.0 +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] Entire actual: +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .assembly extern runtime { } +[xUnit.net 00:00:09.49] .assembly extern FSharp.Core { } +[xUnit.net 00:00:09.49] .assembly 'assembly' +[xUnit.net 00:00:09.49] { +[xUnit.net 00:00:09.49] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, +[xUnit.net 00:00:09.49] int32, +[xUnit.net 00:00:09.49] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .hash algorithm 0x00008004 +[xUnit.net 00:00:09.49] .ver 0:0:0:0 +[xUnit.net 00:00:09.49] } +[xUnit.net 00:00:09.49] .module 'assembly.dll' +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .imagebase {value} +[xUnit.net 00:00:09.49] .file alignment 0x00000200 +[xUnit.net 00:00:09.49] .stackreserve 0x00100000 +[xUnit.net 00:00:09.49] .subsystem 0x0003 +[xUnit.net 00:00:09.49] .corflags 0x00000001 +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .class public abstract auto ansi sealed TailCall06 +[xUnit.net 00:00:09.49] extends [runtime]System.Object +[xUnit.net 00:00:09.49] { +[xUnit.net 00:00:09.49] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) +[xUnit.net 00:00:09.49] .method public static void foo<a>(int32 x, +[xUnit.net 00:00:09.49] !!a y) cil managed +[xUnit.net 00:00:09.49] { +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .maxstack 8 +[xUnit.net 00:00:09.49] IL_0000: ldstr "%d" +[xUnit.net 00:00:09.49] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) +[xUnit.net 00:00:09.49] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) +[xUnit.net 00:00:09.49] IL_000f: ldarg.0 +[xUnit.net 00:00:09.49] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) +[xUnit.net 00:00:09.49] IL_0015: pop +[xUnit.net 00:00:09.49] IL_0016: ret +[xUnit.net 00:00:09.49] } +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .method public static void run() cil managed +[xUnit.net 00:00:09.49] { +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] .maxstack 6 +[xUnit.net 00:00:09.49] .locals init (native int V_0, +[xUnit.net 00:00:09.49] int32[] V_1, +[xUnit.net 00:00:09.49] int32& pinned V_2) +[xUnit.net 00:00:09.49] IL_0000: ldc.i4.3 +[xUnit.net 00:00:09.49] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:09.49] IL_0006: dup +[xUnit.net 00:00:09.49] IL_0007: ldc.i4.0 +[xUnit.net 00:00:09.49] IL_0008: ldc.i4.1 +[xUnit.net 00:00:09.49] IL_0009: stelem [runtime]System.Int32 +[xUnit.net 00:00:09.49] IL_000e: dup +[xUnit.net 00:00:09.49] IL_000f: ldc.i4.1 +[xUnit.net 00:00:09.49] IL_0010: ldc.i4.2 +[xUnit.net 00:00:09.49] IL_0011: stelem [runtime]System.Int32 +[xUnit.net 00:00:09.49] IL_0016: dup +[xUnit.net 00:00:09.49] IL_0017: ldc.i4.2 +[xUnit.net 00:00:09.49] IL_0018: ldc.i4.3 +[xUnit.net 00:00:09.49] IL_0019: stelem [runtime]System.Int32 +[xUnit.net 00:00:09.49] IL_001e: stloc.1 +[xUnit.net 00:00:09.49] IL_001f: ldloc.1 +[xUnit.net 00:00:09.49] IL_0020: brfalse.s IL_003c +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] IL_0022: ldloc.1 +[xUnit.net 00:00:09.49] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +[xUnit.net 00:00:09.49] IL_0028: brfalse.s IL_0037 +[xUnit.net 00:00:09.49] +[xUnit.net 00:00:09.49] IL_002a: ldloc.1 +[xUnit.net 00:00:09.49] IL_002b: ldc.i4.0 +[xUnit.net 00:00:09.49] IL_002c: ldelema [runtime]System.Int32 +[xUnit.net 00:00:09.49] IL_0031: stloc.2 +[xUnit.net 00:00:09.49] IL_0032: ldloc.2 +[xUnit.net 00:00:09.50] IL_0033: conv.i +[xUnit.net 00:00:09.50] IL_0034: nop +[xUnit.net 00:00:09.50] IL_0035: br.s IL_003f +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] IL_0037: ldc.i4.0 +[xUnit.net 00:00:09.50] IL_0038: conv.i +[xUnit.net 00:00:09.50] IL_0039: nop +[xUnit.net 00:00:09.50] IL_003a: br.s IL_003f +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] IL_003c: ldc.i4.0 +[xUnit.net 00:00:09.50] IL_003d: conv.i +[xUnit.net 00:00:09.50] IL_003e: nop +[xUnit.net 00:00:09.50] IL_003f: stloc.0 +[xUnit.net 00:00:09.50] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:09.50] IL_0042: ldc.i4.5 +[xUnit.net 00:00:09.50] IL_0043: tail. +[xUnit.net 00:00:09.50] IL_0045: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.50] !!0) +[xUnit.net 00:00:09.50] IL_004a: ret +[xUnit.net 00:00:09.50] } +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] } +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 +[xUnit.net 00:00:09.50] extends [runtime]System.Object +[xUnit.net 00:00:09.50] { +[xUnit.net 00:00:09.50] } +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] +[xUnit.net 00:00:09.50] Stack Trace: +[xUnit.net 00:00:09.50] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:09.50] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:09.50] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:09.50] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() +[xUnit.net 00:00:09.50] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) +[xUnit.net 00:00:09.50] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +[xUnit.net 00:00:16.66] Finished: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:09.47] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] + + + + \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx new file mode 100644 index 00000000000..8513a84ca60 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx @@ -0,0 +1,832 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +== +Name: 'IL_0040: ldc.i4.s 42' + +Expected: IL_0043: call void TailCall06::foo<int32>(int32, +Actual: IL_0043: tail. +== + +== +Name: 'IL_0040: ldc.i4.s 42' + +Expected: !!0) +Actual: IL_0045: call void TailCall06::foo<int32>(int32, +== + +== +Name: 'IL_0040: ldc.i4.s 42' + +Expected: IL_0048: nop +Actual: !!0) +== + +== +Name: 'IL_0040: ldc.i4.s 42' + +Expected: IL_0049: ldc.i4.0 +Actual: IL_004a: ret +== + +\Expected: +IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: call void TailCall06::foo<int32>(int32, + !!0) + IL_0048: nop + IL_0049: ldc.i4.0 + + + +Actual: +IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: tail. + IL_0045: call void TailCall06::foo<int32>(int32, + !!0) + IL_004a: ret + + +Entire actual: + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly assembly +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, + int32, + int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) + + + + + .hash algorithm 0x00008004 + .ver 0:0:0:0 +} +.module assembly.dll + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed TailCall06 + extends [runtime]System.Object +{ + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) + .method public static void foo<a>(int32 x, + !!a y) cil managed + { + + .maxstack 8 + IL_0000: ldstr "%d" + IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) + IL_000f: ldarg.0 + IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) + IL_0015: pop + IL_0016: ret + } + + .method public static void run() cil managed + { + + .maxstack 6 + .locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + IL_0000: ldc.i4.3 + IL_0001: newarr [runtime]System.Int32 + IL_0006: dup + IL_0007: ldc.i4.0 + IL_0008: ldc.i4.1 + IL_0009: stelem [runtime]System.Int32 + IL_000e: dup + IL_000f: ldc.i4.1 + IL_0010: ldc.i4.2 + IL_0011: stelem [runtime]System.Int32 + IL_0016: dup + IL_0017: ldc.i4.2 + IL_0018: ldc.i4.3 + IL_0019: stelem [runtime]System.Int32 + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: brfalse.s IL_003c + + IL_0022: ldloc.1 + IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) + IL_0028: brfalse.s IL_0037 + + IL_002a: ldloc.1 + IL_002b: ldc.i4.0 + IL_002c: ldelema [runtime]System.Int32 + IL_0031: stloc.2 + IL_0032: ldloc.2 + IL_0033: conv.i + IL_0034: nop + IL_0035: br.s IL_003f + + IL_0037: ldc.i4.0 + IL_0038: conv.i + IL_0039: nop + IL_003a: br.s IL_003f + + IL_003c: ldc.i4.0 + IL_003d: conv.i + IL_003e: nop + IL_003f: stloc.0 + IL_0040: ldc.i4.s 42 + IL_0042: ldc.i4.5 + IL_0043: tail. + IL_0045: call void TailCall06::foo<int32>(int32, + !!0) + IL_004a: ret + } + +} + +.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 + extends [runtime]System.Object +{ +} + + + + + + + at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 + at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 + at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) + at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 + at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) + at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Determining projects to restore... + Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/2971f6e9-bc86-46e7-925a-e73152ad35f5.tmp/ProjectFile.fsproj (in 78 ms). +/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/2971f6e9-bc86-46e7-925a-e73152ad35f5.tmp/ProjectFile.fsproj] + ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/2971f6e9-bc86-46e7-925a-e73152ad35f5.tmp/bin/Debug/net10.0/ProjectFile.dll + +Build succeeded. + 0 Warning(s) + 0 Error(s) + +Time Elapsed 00:00:02.51 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.14] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.15] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] Expected: IL_0043: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.70] Actual: IL_0043: tail. +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] Expected: !!0) +[xUnit.net 00:00:09.70] Actual: IL_0045: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] Expected: IL_0048: nop +[xUnit.net 00:00:09.70] Actual: !!0) +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] Expected: IL_0049: ldc.i4.0 +[xUnit.net 00:00:09.70] Actual: IL_004a: ret +[xUnit.net 00:00:09.70] == +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] \Expected: +[xUnit.net 00:00:09.70] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:09.70] IL_0042: ldc.i4.5 +[xUnit.net 00:00:09.70] IL_0043: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.70] !!0) +[xUnit.net 00:00:09.70] IL_0048: nop +[xUnit.net 00:00:09.70] IL_0049: ldc.i4.0 +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] Actual: +[xUnit.net 00:00:09.70] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:09.70] IL_0042: ldc.i4.5 +[xUnit.net 00:00:09.70] IL_0043: tail. +[xUnit.net 00:00:09.70] IL_0045: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.70] !!0) +[xUnit.net 00:00:09.70] IL_004a: ret +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] Entire actual: +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .assembly extern runtime { } +[xUnit.net 00:00:09.70] .assembly extern FSharp.Core { } +[xUnit.net 00:00:09.70] .assembly assembly +[xUnit.net 00:00:09.70] { +[xUnit.net 00:00:09.70] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, +[xUnit.net 00:00:09.70] int32, +[xUnit.net 00:00:09.70] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .hash algorithm 0x00008004 +[xUnit.net 00:00:09.70] .ver 0:0:0:0 +[xUnit.net 00:00:09.70] } +[xUnit.net 00:00:09.70] .module assembly.dll +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .imagebase {value} +[xUnit.net 00:00:09.70] .file alignment 0x00000200 +[xUnit.net 00:00:09.70] .stackreserve 0x00100000 +[xUnit.net 00:00:09.70] .subsystem 0x0003 +[xUnit.net 00:00:09.70] .corflags 0x00000001 +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .class public abstract auto ansi sealed TailCall06 +[xUnit.net 00:00:09.70] extends [runtime]System.Object +[xUnit.net 00:00:09.70] { +[xUnit.net 00:00:09.70] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) +[xUnit.net 00:00:09.70] .method public static void foo<a>(int32 x, +[xUnit.net 00:00:09.70] !!a y) cil managed +[xUnit.net 00:00:09.70] { +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .maxstack 8 +[xUnit.net 00:00:09.70] IL_0000: ldstr "%d" +[xUnit.net 00:00:09.70] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) +[xUnit.net 00:00:09.70] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) +[xUnit.net 00:00:09.70] IL_000f: ldarg.0 +[xUnit.net 00:00:09.70] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) +[xUnit.net 00:00:09.70] IL_0015: pop +[xUnit.net 00:00:09.70] IL_0016: ret +[xUnit.net 00:00:09.70] } +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .method public static void run() cil managed +[xUnit.net 00:00:09.70] { +[xUnit.net 00:00:09.70] +[xUnit.net 00:00:09.70] .maxstack 6 +[xUnit.net 00:00:09.70] .locals init (native int V_0, +[xUnit.net 00:00:09.70] int32[] V_1, +[xUnit.net 00:00:09.71] int32& pinned V_2) +[xUnit.net 00:00:09.71] IL_0000: ldc.i4.3 +[xUnit.net 00:00:09.71] IL_0001: newarr [runtime]System.Int32 +[xUnit.net 00:00:09.71] IL_0006: dup +[xUnit.net 00:00:09.71] IL_0007: ldc.i4.0 +[xUnit.net 00:00:09.71] IL_0008: ldc.i4.1 +[xUnit.net 00:00:09.71] IL_0009: stelem [runtime]System.Int32 +[xUnit.net 00:00:09.71] IL_000e: dup +[xUnit.net 00:00:09.71] IL_000f: ldc.i4.1 +[xUnit.net 00:00:09.71] IL_0010: ldc.i4.2 +[xUnit.net 00:00:09.71] IL_0011: stelem [runtime]System.Int32 +[xUnit.net 00:00:09.71] IL_0016: dup +[xUnit.net 00:00:09.71] IL_0017: ldc.i4.2 +[xUnit.net 00:00:09.71] IL_0018: ldc.i4.3 +[xUnit.net 00:00:09.71] IL_0019: stelem [runtime]System.Int32 +[xUnit.net 00:00:09.71] IL_001e: stloc.1 +[xUnit.net 00:00:09.71] IL_001f: ldloc.1 +[xUnit.net 00:00:09.71] IL_0020: brfalse.s IL_003c +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] IL_0022: ldloc.1 +[xUnit.net 00:00:09.71] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) +[xUnit.net 00:00:09.71] IL_0028: brfalse.s IL_0037 +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] IL_002a: ldloc.1 +[xUnit.net 00:00:09.71] IL_002b: ldc.i4.0 +[xUnit.net 00:00:09.71] IL_002c: ldelema [runtime]System.Int32 +[xUnit.net 00:00:09.71] IL_0031: stloc.2 +[xUnit.net 00:00:09.71] IL_0032: ldloc.2 +[xUnit.net 00:00:09.71] IL_0033: conv.i +[xUnit.net 00:00:09.71] IL_0034: nop +[xUnit.net 00:00:09.71] IL_0035: br.s IL_003f +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] IL_0037: ldc.i4.0 +[xUnit.net 00:00:09.71] IL_0038: conv.i +[xUnit.net 00:00:09.71] IL_0039: nop +[xUnit.net 00:00:09.71] IL_003a: br.s IL_003f +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] IL_003c: ldc.i4.0 +[xUnit.net 00:00:09.71] IL_003d: conv.i +[xUnit.net 00:00:09.71] IL_003e: nop +[xUnit.net 00:00:09.71] IL_003f: stloc.0 +[xUnit.net 00:00:09.71] IL_0040: ldc.i4.s 42 +[xUnit.net 00:00:09.71] IL_0042: ldc.i4.5 +[xUnit.net 00:00:09.71] IL_0043: tail. +[xUnit.net 00:00:09.71] IL_0045: call void TailCall06::foo<int32>(int32, +[xUnit.net 00:00:09.71] !!0) +[xUnit.net 00:00:09.71] IL_004a: ret +[xUnit.net 00:00:09.71] } +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] } +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 +[xUnit.net 00:00:09.71] extends [runtime]System.Object +[xUnit.net 00:00:09.71] { +[xUnit.net 00:00:09.71] } +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] +[xUnit.net 00:00:09.71] Stack Trace: +[xUnit.net 00:00:09.72] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:09.72] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:09.72] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) +[xUnit.net 00:00:09.72] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() +[xUnit.net 00:00:09.72] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) +[xUnit.net 00:00:09.72] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +[xUnit.net 00:00:16.90] Finished: FSharp.Compiler.ComponentTests + + + + + [xUnit.net 00:00:09.70] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] + + + + \ No newline at end of file diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 08020ebf21b..480cce0a7d5 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1250,6 +1250,9 @@ and IlxGenEnv = /// Indicates that the .locals init flag should be set on a method and all its nested methods and lambdas initLocals: bool + /// Indicates whether the current method has pinned locals that would prevent tail calls + hasPinnedLocals: bool + /// Delay code gen for files. delayCodeGen: bool @@ -4371,6 +4374,7 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = isDllImport, isSelfInit, makesNoCriticalTailcalls, + eenv.hasPinnedLocals, sequel ) else @@ -4482,11 +4486,13 @@ and CanTailcall isDllImport, isSelfInit, makesNoCriticalTailcalls, + hasPinnedLocals, sequel ) = // Can't tailcall with a struct object arg since it involves a byref // Can't tailcall with a .NET 2.0 generic constrained call since it involves a byref + // Can't tailcall when there are pinned locals since the stack frame must remain alive if not hasStructObjArg && Option.isNone ccallInfo @@ -4495,6 +4501,7 @@ and CanTailcall && not isDllImport && not isSelfInit && not makesNoCriticalTailcalls + && not hasPinnedLocals && // We can tailcall even if we need to generate "unit", as long as we're about to throw the value away anyway as par of the return. @@ -4693,7 +4700,7 @@ and GenIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel = check ilxClosureApps let isTailCall = - CanTailcall(false, None, eenv.withinSEH, hasByrefArg, false, false, false, false, sequel) + CanTailcall(false, None, eenv.withinSEH, hasByrefArg, false, false, false, false, eenv.hasPinnedLocals, sequel) CountCallFuncInstructions() @@ -5431,6 +5438,7 @@ and GenILCall isDllImport, false, makesNoCriticalTailcalls, + eenv.hasPinnedLocals, sequel ) @@ -9864,6 +9872,7 @@ and AllocLocal cenv cgbuf eenv compgen (v, ty, isFixed) (scopeMarks: Mark * Mark realloc, { eenv with liveLocals = IntMap.add j () eenv.liveLocals + hasPinnedLocals = eenv.hasPinnedLocals || isFixed } /// Decide storage for local value and if necessary allocate an ILLocal for it @@ -12020,6 +12029,7 @@ let GetEmptyIlxGenEnv (g: TcGlobals) ccu = withinSEH = false isInLoop = false initLocals = true + hasPinnedLocals = false imports = None delayCodeGen = true delayedFileGenReverse = [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs index 4151a5281e4..47db7bf43b6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs @@ -248,17 +248,12 @@ let run() = |> shouldSucceed |> verifyIL [ """ - .method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) IL_0040: ldc.i4.s 42 IL_0042: ldc.i4.5 IL_0043: call void TailCall06::foo(int32, !!0) + IL_0048: nop + IL_0049: ldc.i4.0 """ ] From ff7379c563af97f45d343c796e83f02cdfddcf2f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 16:42:07 +0000 Subject: [PATCH 4/6] Implement fix to prevent tail calls when pinned locals are present Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .../_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx | 45 +++++++++++++++++++ src/Compiler/CodeGen/IlxGen.fs | 18 ++++---- .../EmittedIL/TailCalls.fs | 2 - 3 files changed, 54 insertions(+), 11 deletions(-) create mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx new file mode 100644 index 00000000000..2df244fe411 --- /dev/null +++ b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) +Installing TestConsole redirection +--------------------------------------------------------------- +Executables +CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe +BUILD_CONFIG = Release +csc_flags = /nologo +FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll +fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US +FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll +FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +DotNetExe = dotnet +DOTNET_MULTILEVEL_LOOKUP = 0 +DOTNET_ROOT = /usr/share/dotnet +FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll +fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US +ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm +PEVERIFY = ilverify +--------------------------------------------------------------- +[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.16] Discovered: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.17] Starting: FSharp.Compiler.ComponentTests +[xUnit.net 00:00:01.19] Finished: FSharp.Compiler.ComponentTests + + + + + No test matches the given testcase filter `DisplayName~'TailCall 06'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll + + + + \ No newline at end of file diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 480cce0a7d5..0ecb4142d03 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -1250,9 +1250,6 @@ and IlxGenEnv = /// Indicates that the .locals init flag should be set on a method and all its nested methods and lambdas initLocals: bool - /// Indicates whether the current method has pinned locals that would prevent tail calls - hasPinnedLocals: bool - /// Delay code gen for files. delayCodeGen: bool @@ -2692,6 +2689,10 @@ type CodeGenBuffer(m: range, mgbuf: AssemblyBuilder, methodName, alreadyUsedArgs j, true | None -> cgbuf.AllocLocal(ranges, ty, isFixed, canBeReallocd), false + /// Check if any locals have been allocated as pinned/fixed + member _.HasPinnedLocals() = + locals |> Seq.exists (fun (_, _, isFixed, _) -> isFixed) + member _.Close() = let instrs = codebuf.ToArray() @@ -4374,7 +4375,7 @@ and GenApp (cenv: cenv) cgbuf eenv (f, fty, tyargs, curriedArgs, m) sequel = isDllImport, isSelfInit, makesNoCriticalTailcalls, - eenv.hasPinnedLocals, + cgbuf, sequel ) else @@ -4486,13 +4487,14 @@ and CanTailcall isDllImport, isSelfInit, makesNoCriticalTailcalls, - hasPinnedLocals, + cgbuf: CodeGenBuffer, sequel ) = // Can't tailcall with a struct object arg since it involves a byref // Can't tailcall with a .NET 2.0 generic constrained call since it involves a byref // Can't tailcall when there are pinned locals since the stack frame must remain alive + let hasPinnedLocals = cgbuf.HasPinnedLocals() if not hasStructObjArg && Option.isNone ccallInfo @@ -4700,7 +4702,7 @@ and GenIndirectCall cenv cgbuf eenv (funcTy, tyargs, curriedArgs, m) sequel = check ilxClosureApps let isTailCall = - CanTailcall(false, None, eenv.withinSEH, hasByrefArg, false, false, false, false, eenv.hasPinnedLocals, sequel) + CanTailcall(false, None, eenv.withinSEH, hasByrefArg, false, false, false, false, cgbuf, sequel) CountCallFuncInstructions() @@ -5438,7 +5440,7 @@ and GenILCall isDllImport, false, makesNoCriticalTailcalls, - eenv.hasPinnedLocals, + cgbuf, sequel ) @@ -9872,7 +9874,6 @@ and AllocLocal cenv cgbuf eenv compgen (v, ty, isFixed) (scopeMarks: Mark * Mark realloc, { eenv with liveLocals = IntMap.add j () eenv.liveLocals - hasPinnedLocals = eenv.hasPinnedLocals || isFixed } /// Decide storage for local value and if necessary allocate an ILLocal for it @@ -12029,7 +12030,6 @@ let GetEmptyIlxGenEnv (g: TcGlobals) ccu = withinSEH = false isInLoop = false initLocals = true - hasPinnedLocals = false imports = None delayCodeGen = true delayedFileGenReverse = [] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs index 47db7bf43b6..021f87dcede 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs @@ -252,8 +252,6 @@ let run() = IL_0042: ldc.i4.5 IL_0043: call void TailCall06::foo(int32, !!0) - IL_0048: nop - IL_0049: ldc.i4.0 """ ] From 3c000d9f639f814d9343d128b791e78f3ecb4a43 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 17 Sep 2025 17:49:29 +0000 Subject: [PATCH 5/6] Fix PR review comments: remove mutable, gitignore .trx files, add recursive test, add release notes, format code Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- .gitignore | 1 + .../_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx | 1416 ----------------- .../_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx | 45 - .../_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx | 45 - .../_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx | 856 ---------- .../_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx | 45 - .../_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx | 45 - .../_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx | 852 ---------- .../_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx | 832 ---------- .../_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx | 45 - .../.FSharp.Compiler.Service/9.0.300.md | 1 + src/Compiler/Checking/TailCallChecks.fs | 9 +- src/Compiler/CodeGen/IlxGen.fs | 1 + .../EmittedIL/TailCalls.fs | 21 + 14 files changed, 30 insertions(+), 4184 deletions(-) delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx delete mode 100644 TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx diff --git a/.gitignore b/.gitignore index 49032888dca..822b0ef242d 100644 --- a/.gitignore +++ b/.gitignore @@ -142,6 +142,7 @@ positive.exe # Test result files tests/**/TestResults/*.trx +TestResults/*.trx # Standard output/error files in root directory StandardOutput.txt diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx deleted file mode 100644 index a66fbd8b862..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_18_58.trx +++ /dev/null @@ -1,1416 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -== -Name: '.method public static void run() cil managed' - -Expected: .maxstack 4 -Actual: .maxstack 6 -== - -== -Name: '.method public static void run() cil managed' - -Expected: int32& pinned V_1) -Actual: int32[] V_1, -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0000: ldc.i4.3 -Actual: int32& pinned V_2) -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0001: newarr [runtime]System.Int32 -Actual: IL_0000: ldc.i4.3 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0006: dup -Actual: IL_0001: newarr [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0007: ldc.i4.0 -Actual: IL_0006: dup -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0008: ldc.i4.1 -Actual: IL_0007: ldc.i4.0 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0009: stelem.i4 -Actual: IL_0008: ldc.i4.1 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_000a: dup -Actual: IL_0009: stelem [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_000b: ldc.i4.1 -Actual: IL_000e: dup -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_000c: ldc.i4.2 -Actual: IL_000f: ldc.i4.1 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_000d: stelem.i4 -Actual: IL_0010: ldc.i4.2 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_000e: dup -Actual: IL_0011: stelem [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_000f: ldc.i4.2 -Actual: IL_0016: dup -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0010: ldc.i4.3 -Actual: IL_0017: ldc.i4.2 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0011: stelem.i4 -Actual: IL_0018: ldc.i4.3 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0012: dup -Actual: IL_0019: stelem [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0013: brfalse.s IL_001c -Actual: IL_001e: stloc.1 -== - -== -Name: '.method public static void run() cil managed' - -Expected: -Actual: IL_001f: ldloc.1 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0015: dup -Actual: IL_0020: brfalse.s IL_003c -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0016: ldc.i4.0 -Actual: -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0017: ldelema [runtime]System.Int32 -Actual: IL_0022: ldloc.1 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_001c: stloc.1 -Actual: IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_001d: ldloc.1 -Actual: IL_0028: brfalse.s IL_0037 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_001e: conv.i -Actual: -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_001f: stloc.0 -Actual: IL_002a: ldloc.1 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0020: ldc.i4.s 42 -Actual: IL_002b: ldc.i4.0 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0022: ldc.i4.5 -Actual: IL_002c: ldelema [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0023: call void TailCall06::foo<int32>(int32, -Actual: IL_0031: stloc.2 -== - -== -Name: '.method public static void run() cil managed' - -Expected: !!0) -Actual: IL_0032: ldloc.2 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0028: nop -Actual: IL_0033: conv.i -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0029: ldc.i4.0 -Actual: IL_0034: nop -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_002a: conv.i -Actual: IL_0035: br.s IL_003f -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_002b: stloc.1 -Actual: -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_002c: ret -Actual: IL_0037: ldc.i4.0 -== - -== -Name: '.method public static void run() cil managed' - -Expected: } -Actual: IL_0038: conv.i -== - -\Expected: -.method public static void run() cil managed - { - - .maxstack 4 - .locals init (native int V_0, - int32& pinned V_1) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.i4.1 - IL_0009: stelem.i4 - IL_000a: dup - IL_000b: ldc.i4.1 - IL_000c: ldc.i4.2 - IL_000d: stelem.i4 - IL_000e: dup - IL_000f: ldc.i4.2 - IL_0010: ldc.i4.3 - IL_0011: stelem.i4 - IL_0012: dup - IL_0013: brfalse.s IL_001c - - IL_0015: dup - IL_0016: ldc.i4.0 - IL_0017: ldelema [runtime]System.Int32 - IL_001c: stloc.1 - IL_001d: ldloc.1 - IL_001e: conv.i - IL_001f: stloc.0 - IL_0020: ldc.i4.s 42 - IL_0022: ldc.i4.5 - IL_0023: call void TailCall06::foo<int32>(int32, - !!0) - IL_0028: nop - IL_0029: ldc.i4.0 - IL_002a: conv.i - IL_002b: stloc.1 - IL_002c: ret - } - - - -Actual: -.method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.i4.1 - IL_0009: stelem [runtime]System.Int32 - IL_000e: dup - IL_000f: ldc.i4.1 - IL_0010: ldc.i4.2 - IL_0011: stelem [runtime]System.Int32 - IL_0016: dup - IL_0017: ldc.i4.2 - IL_0018: ldc.i4.3 - IL_0019: stelem [runtime]System.Int32 - IL_001e: stloc.1 - IL_001f: ldloc.1 - IL_0020: brfalse.s IL_003c - - IL_0022: ldloc.1 - IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) - IL_0028: brfalse.s IL_0037 - - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: ldelema [runtime]System.Int32 - IL_0031: stloc.2 - IL_0032: ldloc.2 - IL_0033: conv.i - IL_0034: nop - IL_0035: br.s IL_003f - - IL_0037: ldc.i4.0 - IL_0038: conv.i - - -Entire actual: - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly 'assembly' -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.module 'assembly.dll' - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed TailCall06 - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static void foo<a>(int32 x, - !!a y) cil managed - { - - .maxstack 8 - IL_0000: ldstr "%d" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0015: pop - IL_0016: ret - } - - .method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.i4.1 - IL_0009: stelem [runtime]System.Int32 - IL_000e: dup - IL_000f: ldc.i4.1 - IL_0010: ldc.i4.2 - IL_0011: stelem [runtime]System.Int32 - IL_0016: dup - IL_0017: ldc.i4.2 - IL_0018: ldc.i4.3 - IL_0019: stelem [runtime]System.Int32 - IL_001e: stloc.1 - IL_001f: ldloc.1 - IL_0020: brfalse.s IL_003c - - IL_0022: ldloc.1 - IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) - IL_0028: brfalse.s IL_0037 - - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: ldelema [runtime]System.Int32 - IL_0031: stloc.2 - IL_0032: ldloc.2 - IL_0033: conv.i - IL_0034: nop - IL_0035: br.s IL_003f - - IL_0037: ldc.i4.0 - IL_0038: conv.i - IL_0039: nop - IL_003a: br.s IL_003f - - IL_003c: ldc.i4.0 - IL_003d: conv.i - IL_003e: nop - IL_003f: stloc.0 - IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: tail. - IL_0045: call void TailCall06::foo<int32>(int32, - !!0) - IL_004a: ret - } - -} - -.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 - extends [runtime]System.Object -{ -} - - - - - - - at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 - at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 - at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) - at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 - at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) - at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) - - - - - - - - - - - - Determining projects to restore... - Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/1b0a3d90-0de5-4313-b60e-54e70cbf18ea.tmp/ProjectFile.fsproj (in 98 ms). -/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/1b0a3d90-0de5-4313-b60e-54e70cbf18ea.tmp/ProjectFile.fsproj] - ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/1b0a3d90-0de5-4313-b60e-54e70cbf18ea.tmp/bin/Debug/net10.0/ProjectFile.dll - -Build succeeded. - 0 Warning(s) - 0 Error(s) - -Time Elapsed 00:00:02.52 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.09] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.10] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: .maxstack 4 -[xUnit.net 00:00:11.23] Actual: .maxstack 6 -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: int32& pinned V_1) -[xUnit.net 00:00:11.23] Actual: int32[] V_1, -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_0000: ldc.i4.3 -[xUnit.net 00:00:11.23] Actual: int32& pinned V_2) -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:11.23] Actual: IL_0000: ldc.i4.3 -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_0006: dup -[xUnit.net 00:00:11.23] Actual: IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_0007: ldc.i4.0 -[xUnit.net 00:00:11.23] Actual: IL_0006: dup -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_0008: ldc.i4.1 -[xUnit.net 00:00:11.23] Actual: IL_0007: ldc.i4.0 -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_0009: stelem.i4 -[xUnit.net 00:00:11.23] Actual: IL_0008: ldc.i4.1 -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_000a: dup -[xUnit.net 00:00:11.23] Actual: IL_0009: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.23] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.23] -[xUnit.net 00:00:11.23] Expected: IL_000b: ldc.i4.1 -[xUnit.net 00:00:11.23] Actual: IL_000e: dup -[xUnit.net 00:00:11.23] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_000c: ldc.i4.2 -[xUnit.net 00:00:11.28] Actual: IL_000f: ldc.i4.1 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_000d: stelem.i4 -[xUnit.net 00:00:11.28] Actual: IL_0010: ldc.i4.2 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_000e: dup -[xUnit.net 00:00:11.28] Actual: IL_0011: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_000f: ldc.i4.2 -[xUnit.net 00:00:11.28] Actual: IL_0016: dup -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_0010: ldc.i4.3 -[xUnit.net 00:00:11.28] Actual: IL_0017: ldc.i4.2 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_0011: stelem.i4 -[xUnit.net 00:00:11.28] Actual: IL_0018: ldc.i4.3 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_0012: dup -[xUnit.net 00:00:11.28] Actual: IL_0019: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_0013: brfalse.s IL_001c -[xUnit.net 00:00:11.28] Actual: IL_001e: stloc.1 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: -[xUnit.net 00:00:11.28] Actual: IL_001f: ldloc.1 -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] == -[xUnit.net 00:00:11.28] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.28] -[xUnit.net 00:00:11.28] Expected: IL_0015: dup -[xUnit.net 00:00:11.29] Actual: IL_0020: brfalse.s IL_003c -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0016: ldc.i4.0 -[xUnit.net 00:00:11.29] Actual: -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0017: ldelema [runtime]System.Int32 -[xUnit.net 00:00:11.29] Actual: IL_0022: ldloc.1 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_001c: stloc.1 -[xUnit.net 00:00:11.29] Actual: IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_001d: ldloc.1 -[xUnit.net 00:00:11.29] Actual: IL_0028: brfalse.s IL_0037 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_001e: conv.i -[xUnit.net 00:00:11.29] Actual: -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_001f: stloc.0 -[xUnit.net 00:00:11.29] Actual: IL_002a: ldloc.1 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0020: ldc.i4.s 42 -[xUnit.net 00:00:11.29] Actual: IL_002b: ldc.i4.0 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0022: ldc.i4.5 -[xUnit.net 00:00:11.29] Actual: IL_002c: ldelema [runtime]System.Int32 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0023: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:11.29] Actual: IL_0031: stloc.2 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: !!0) -[xUnit.net 00:00:11.29] Actual: IL_0032: ldloc.2 -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0028: nop -[xUnit.net 00:00:11.29] Actual: IL_0033: conv.i -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_0029: ldc.i4.0 -[xUnit.net 00:00:11.29] Actual: IL_0034: nop -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] Expected: IL_002a: conv.i -[xUnit.net 00:00:11.29] Actual: IL_0035: br.s IL_003f -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.29] == -[xUnit.net 00:00:11.29] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.29] -[xUnit.net 00:00:11.30] Expected: IL_002b: stloc.1 -[xUnit.net 00:00:11.30] Actual: -[xUnit.net 00:00:11.30] == -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] == -[xUnit.net 00:00:11.30] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] Expected: IL_002c: ret -[xUnit.net 00:00:11.30] Actual: IL_0037: ldc.i4.0 -[xUnit.net 00:00:11.30] == -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] == -[xUnit.net 00:00:11.30] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] Expected: } -[xUnit.net 00:00:11.30] Actual: IL_0038: conv.i -[xUnit.net 00:00:11.30] == -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] \Expected: -[xUnit.net 00:00:11.30] .method public static void run() cil managed -[xUnit.net 00:00:11.30] { -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] .maxstack 4 -[xUnit.net 00:00:11.30] .locals init (native int V_0, -[xUnit.net 00:00:11.30] int32& pinned V_1) -[xUnit.net 00:00:11.30] IL_0000: ldc.i4.3 -[xUnit.net 00:00:11.30] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:11.30] IL_0006: dup -[xUnit.net 00:00:11.30] IL_0007: ldc.i4.0 -[xUnit.net 00:00:11.30] IL_0008: ldc.i4.1 -[xUnit.net 00:00:11.30] IL_0009: stelem.i4 -[xUnit.net 00:00:11.30] IL_000a: dup -[xUnit.net 00:00:11.30] IL_000b: ldc.i4.1 -[xUnit.net 00:00:11.30] IL_000c: ldc.i4.2 -[xUnit.net 00:00:11.30] IL_000d: stelem.i4 -[xUnit.net 00:00:11.30] IL_000e: dup -[xUnit.net 00:00:11.30] IL_000f: ldc.i4.2 -[xUnit.net 00:00:11.30] IL_0010: ldc.i4.3 -[xUnit.net 00:00:11.30] IL_0011: stelem.i4 -[xUnit.net 00:00:11.30] IL_0012: dup -[xUnit.net 00:00:11.30] IL_0013: brfalse.s IL_001c -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] IL_0015: dup -[xUnit.net 00:00:11.30] IL_0016: ldc.i4.0 -[xUnit.net 00:00:11.30] IL_0017: ldelema [runtime]System.Int32 -[xUnit.net 00:00:11.30] IL_001c: stloc.1 -[xUnit.net 00:00:11.30] IL_001d: ldloc.1 -[xUnit.net 00:00:11.30] IL_001e: conv.i -[xUnit.net 00:00:11.30] IL_001f: stloc.0 -[xUnit.net 00:00:11.30] IL_0020: ldc.i4.s 42 -[xUnit.net 00:00:11.30] IL_0022: ldc.i4.5 -[xUnit.net 00:00:11.30] IL_0023: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:11.30] !!0) -[xUnit.net 00:00:11.30] IL_0028: nop -[xUnit.net 00:00:11.30] IL_0029: ldc.i4.0 -[xUnit.net 00:00:11.30] IL_002a: conv.i -[xUnit.net 00:00:11.30] IL_002b: stloc.1 -[xUnit.net 00:00:11.30] IL_002c: ret -[xUnit.net 00:00:11.30] } -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] Actual: -[xUnit.net 00:00:11.30] .method public static void run() cil managed -[xUnit.net 00:00:11.30] { -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] .maxstack 6 -[xUnit.net 00:00:11.30] .locals init (native int V_0, -[xUnit.net 00:00:11.30] int32[] V_1, -[xUnit.net 00:00:11.30] int32& pinned V_2) -[xUnit.net 00:00:11.30] IL_0000: ldc.i4.3 -[xUnit.net 00:00:11.30] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:11.30] IL_0006: dup -[xUnit.net 00:00:11.30] IL_0007: ldc.i4.0 -[xUnit.net 00:00:11.30] IL_0008: ldc.i4.1 -[xUnit.net 00:00:11.30] IL_0009: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.30] IL_000e: dup -[xUnit.net 00:00:11.30] IL_000f: ldc.i4.1 -[xUnit.net 00:00:11.30] IL_0010: ldc.i4.2 -[xUnit.net 00:00:11.30] IL_0011: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.30] IL_0016: dup -[xUnit.net 00:00:11.30] IL_0017: ldc.i4.2 -[xUnit.net 00:00:11.30] IL_0018: ldc.i4.3 -[xUnit.net 00:00:11.30] IL_0019: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.30] IL_001e: stloc.1 -[xUnit.net 00:00:11.30] IL_001f: ldloc.1 -[xUnit.net 00:00:11.30] IL_0020: brfalse.s IL_003c -[xUnit.net 00:00:11.30] -[xUnit.net 00:00:11.30] IL_0022: ldloc.1 -[xUnit.net 00:00:11.31] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -[xUnit.net 00:00:11.31] IL_0028: brfalse.s IL_0037 -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] IL_002a: ldloc.1 -[xUnit.net 00:00:11.31] IL_002b: ldc.i4.0 -[xUnit.net 00:00:11.31] IL_002c: ldelema [runtime]System.Int32 -[xUnit.net 00:00:11.31] IL_0031: stloc.2 -[xUnit.net 00:00:11.31] IL_0032: ldloc.2 -[xUnit.net 00:00:11.31] IL_0033: conv.i -[xUnit.net 00:00:11.31] IL_0034: nop -[xUnit.net 00:00:11.31] IL_0035: br.s IL_003f -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] IL_0037: ldc.i4.0 -[xUnit.net 00:00:11.31] IL_0038: conv.i -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] Entire actual: -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] .assembly extern runtime { } -[xUnit.net 00:00:11.31] .assembly extern FSharp.Core { } -[xUnit.net 00:00:11.31] .assembly 'assembly' -[xUnit.net 00:00:11.31] { -[xUnit.net 00:00:11.31] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, -[xUnit.net 00:00:11.31] int32, -[xUnit.net 00:00:11.31] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] .hash algorithm 0x00008004 -[xUnit.net 00:00:11.31] .ver 0:0:0:0 -[xUnit.net 00:00:11.31] } -[xUnit.net 00:00:11.31] .module 'assembly.dll' -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] .imagebase {value} -[xUnit.net 00:00:11.31] .file alignment 0x00000200 -[xUnit.net 00:00:11.31] .stackreserve 0x00100000 -[xUnit.net 00:00:11.31] .subsystem 0x0003 -[xUnit.net 00:00:11.31] .corflags 0x00000001 -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.31] -[xUnit.net 00:00:11.32] -[xUnit.net 00:00:11.32] -[xUnit.net 00:00:11.32] -[xUnit.net 00:00:11.32] .class public abstract auto ansi sealed TailCall06 -[xUnit.net 00:00:11.32] extends [runtime]System.Object -[xUnit.net 00:00:11.32] { -[xUnit.net 00:00:11.32] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) -[xUnit.net 00:00:11.32] .method public static void foo<a>(int32 x, -[xUnit.net 00:00:11.32] !!a y) cil managed -[xUnit.net 00:00:11.32] { -[xUnit.net 00:00:11.32] -[xUnit.net 00:00:11.32] .maxstack 8 -[xUnit.net 00:00:11.32] IL_0000: ldstr "%d" -[xUnit.net 00:00:11.32] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) -[xUnit.net 00:00:11.32] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) -[xUnit.net 00:00:11.32] IL_000f: ldarg.0 -[xUnit.net 00:00:11.32] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) -[xUnit.net 00:00:11.32] IL_0015: pop -[xUnit.net 00:00:11.32] IL_0016: ret -[xUnit.net 00:00:11.32] } -[xUnit.net 00:00:11.32] -[xUnit.net 00:00:11.32] .method public static void run() cil managed -[xUnit.net 00:00:11.32] { -[xUnit.net 00:00:11.32] -[xUnit.net 00:00:11.32] .maxstack 6 -[xUnit.net 00:00:11.32] .locals init (native int V_0, -[xUnit.net 00:00:11.32] int32[] V_1, -[xUnit.net 00:00:11.32] int32& pinned V_2) -[xUnit.net 00:00:11.32] IL_0000: ldc.i4.3 -[xUnit.net 00:00:11.32] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:11.32] IL_0006: dup -[xUnit.net 00:00:11.32] IL_0007: ldc.i4.0 -[xUnit.net 00:00:11.32] IL_0008: ldc.i4.1 -[xUnit.net 00:00:11.32] IL_0009: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.32] IL_000e: dup -[xUnit.net 00:00:11.32] IL_000f: ldc.i4.1 -[xUnit.net 00:00:11.32] IL_0010: ldc.i4.2 -[xUnit.net 00:00:11.33] IL_0011: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.33] IL_0016: dup -[xUnit.net 00:00:11.33] IL_0017: ldc.i4.2 -[xUnit.net 00:00:11.33] IL_0018: ldc.i4.3 -[xUnit.net 00:00:11.33] IL_0019: stelem [runtime]System.Int32 -[xUnit.net 00:00:11.33] IL_001e: stloc.1 -[xUnit.net 00:00:11.33] IL_001f: ldloc.1 -[xUnit.net 00:00:11.33] IL_0020: brfalse.s IL_003c -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] IL_0022: ldloc.1 -[xUnit.net 00:00:11.33] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -[xUnit.net 00:00:11.33] IL_0028: brfalse.s IL_0037 -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] IL_002a: ldloc.1 -[xUnit.net 00:00:11.33] IL_002b: ldc.i4.0 -[xUnit.net 00:00:11.33] IL_002c: ldelema [runtime]System.Int32 -[xUnit.net 00:00:11.33] IL_0031: stloc.2 -[xUnit.net 00:00:11.33] IL_0032: ldloc.2 -[xUnit.net 00:00:11.33] IL_0033: conv.i -[xUnit.net 00:00:11.33] IL_0034: nop -[xUnit.net 00:00:11.33] IL_0035: br.s IL_003f -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] IL_0037: ldc.i4.0 -[xUnit.net 00:00:11.33] IL_0038: conv.i -[xUnit.net 00:00:11.33] IL_0039: nop -[xUnit.net 00:00:11.33] IL_003a: br.s IL_003f -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] IL_003c: ldc.i4.0 -[xUnit.net 00:00:11.33] IL_003d: conv.i -[xUnit.net 00:00:11.33] IL_003e: nop -[xUnit.net 00:00:11.33] IL_003f: stloc.0 -[xUnit.net 00:00:11.33] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:11.33] IL_0042: ldc.i4.5 -[xUnit.net 00:00:11.33] IL_0043: tail. -[xUnit.net 00:00:11.33] IL_0045: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:11.33] !!0) -[xUnit.net 00:00:11.33] IL_004a: ret -[xUnit.net 00:00:11.33] } -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] } -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 -[xUnit.net 00:00:11.33] extends [runtime]System.Object -[xUnit.net 00:00:11.33] { -[xUnit.net 00:00:11.33] } -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] -[xUnit.net 00:00:11.33] Stack Trace: -[xUnit.net 00:00:11.33] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:11.33] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:11.33] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:11.33] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() -[xUnit.net 00:00:11.33] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) -[xUnit.net 00:00:11.33] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) -[xUnit.net 00:00:16.49] Finished: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:11.22] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx deleted file mode 100644 index 9989a2dcf28..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_44.trx +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.11] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.12] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.14] Finished: FSharp.Compiler.ComponentTests - - - - - No test matches the given testcase filter `FullyQualifiedName~'TailCall 06'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx deleted file mode 100644 index dbe71b9e14e..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_19_56.trx +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.17] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.17] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.18] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.19] Finished: FSharp.Compiler.ComponentTests - - - - - No test matches the given testcase filter `FullyQualifiedName~TailCall06` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx deleted file mode 100644 index 22494d7fa2f..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_20_38.trx +++ /dev/null @@ -1,856 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Determining projects to restore... - Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/eb25d901-6cea-4057-b4dc-c64a6f55ed2c.tmp/ProjectFile.fsproj (in 83 ms). -/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/eb25d901-6cea-4057-b4dc-c64a6f55ed2c.tmp/ProjectFile.fsproj] - ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/eb25d901-6cea-4057-b4dc-c64a6f55ed2c.tmp/bin/Debug/net10.0/ProjectFile.dll - -Build succeeded. - 0 Warning(s) - 0 Error(s) - -Time Elapsed 00:00:02.47 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0040: ldc.i4.s 42 -Actual: IL_0000: ldc.i4.3 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0042: ldc.i4.5 -Actual: IL_0001: newarr [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0043: call void TailCall06::foo<int32>(int32, -Actual: IL_0006: dup -== - -== -Name: '.method public static void run() cil managed' - -Expected: !!0) -Actual: IL_0007: ldc.i4.0 -== - -\Expected: -.method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: call void TailCall06::foo<int32>(int32, - !!0) - - - -Actual: -.method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - - -Entire actual: - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.module assembly.dll - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed TailCall06 - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static void foo<a>(int32 x, - !!a y) cil managed - { - - .maxstack 8 - IL_0000: ldstr "%d" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0015: pop - IL_0016: ret - } - - .method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.i4.1 - IL_0009: stelem [runtime]System.Int32 - IL_000e: dup - IL_000f: ldc.i4.1 - IL_0010: ldc.i4.2 - IL_0011: stelem [runtime]System.Int32 - IL_0016: dup - IL_0017: ldc.i4.2 - IL_0018: ldc.i4.3 - IL_0019: stelem [runtime]System.Int32 - IL_001e: stloc.1 - IL_001f: ldloc.1 - IL_0020: brfalse.s IL_003c - - IL_0022: ldloc.1 - IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) - IL_0028: brfalse.s IL_0037 - - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: ldelema [runtime]System.Int32 - IL_0031: stloc.2 - IL_0032: ldloc.2 - IL_0033: conv.i - IL_0034: nop - IL_0035: br.s IL_003f - - IL_0037: ldc.i4.0 - IL_0038: conv.i - IL_0039: nop - IL_003a: br.s IL_003f - - IL_003c: ldc.i4.0 - IL_003d: conv.i - IL_003e: nop - IL_003f: stloc.0 - IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: tail. - IL_0045: call void TailCall06::foo<int32>(int32, - !!0) - IL_004a: ret - } - -} - -.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 - extends [runtime]System.Object -{ -} - - - - - - - at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 - at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 - at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) - at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 - at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) - at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) - at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) - at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.20] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.21] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:14.97] -[xUnit.net 00:00:14.97] == -[xUnit.net 00:00:14.97] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:14.97] -[xUnit.net 00:00:14.97] Expected: IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:14.97] Actual: IL_0000: ldc.i4.3 -[xUnit.net 00:00:14.97] == -[xUnit.net 00:00:14.97] -[xUnit.net 00:00:14.97] == -[xUnit.net 00:00:14.97] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:14.97] -[xUnit.net 00:00:14.97] Expected: IL_0042: ldc.i4.5 -[xUnit.net 00:00:14.97] Actual: IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:14.97] == -[xUnit.net 00:00:14.97] -[xUnit.net 00:00:14.98] == -[xUnit.net 00:00:14.98] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] Expected: IL_0043: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:14.98] Actual: IL_0006: dup -[xUnit.net 00:00:14.98] == -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] == -[xUnit.net 00:00:14.98] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] Expected: !!0) -[xUnit.net 00:00:14.98] Actual: IL_0007: ldc.i4.0 -[xUnit.net 00:00:14.98] == -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] \Expected: -[xUnit.net 00:00:14.98] .method public static void run() cil managed -[xUnit.net 00:00:14.98] { -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] .maxstack 6 -[xUnit.net 00:00:14.98] .locals init (native int V_0, -[xUnit.net 00:00:14.98] int32[] V_1, -[xUnit.net 00:00:14.98] int32& pinned V_2) -[xUnit.net 00:00:14.98] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:14.98] IL_0042: ldc.i4.5 -[xUnit.net 00:00:14.98] IL_0043: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:14.98] !!0) -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] Actual: -[xUnit.net 00:00:14.98] .method public static void run() cil managed -[xUnit.net 00:00:14.98] { -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] .maxstack 6 -[xUnit.net 00:00:14.98] .locals init (native int V_0, -[xUnit.net 00:00:14.98] int32[] V_1, -[xUnit.net 00:00:14.98] int32& pinned V_2) -[xUnit.net 00:00:14.98] IL_0000: ldc.i4.3 -[xUnit.net 00:00:14.98] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:14.98] IL_0006: dup -[xUnit.net 00:00:14.98] IL_0007: ldc.i4.0 -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] Entire actual: -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] .assembly extern runtime { } -[xUnit.net 00:00:14.98] .assembly extern FSharp.Core { } -[xUnit.net 00:00:14.98] .assembly assembly -[xUnit.net 00:00:14.98] { -[xUnit.net 00:00:14.98] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, -[xUnit.net 00:00:14.98] int32, -[xUnit.net 00:00:14.98] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] .hash algorithm 0x00008004 -[xUnit.net 00:00:14.98] .ver 0:0:0:0 -[xUnit.net 00:00:14.98] } -[xUnit.net 00:00:14.98] .module assembly.dll -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] .imagebase {value} -[xUnit.net 00:00:14.98] .file alignment 0x00000200 -[xUnit.net 00:00:14.98] .stackreserve 0x00100000 -[xUnit.net 00:00:14.98] .subsystem 0x0003 -[xUnit.net 00:00:14.98] .corflags 0x00000001 -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] -[xUnit.net 00:00:14.98] .class public abstract auto ansi sealed TailCall06 -[xUnit.net 00:00:14.98] extends [runtime]System.Object -[xUnit.net 00:00:14.98] { -[xUnit.net 00:00:14.98] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) -[xUnit.net 00:00:14.98] .method public static void foo<a>(int32 x, -[xUnit.net 00:00:14.98] !!a y) cil managed -[xUnit.net 00:00:14.99] { -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] .maxstack 8 -[xUnit.net 00:00:14.99] IL_0000: ldstr "%d" -[xUnit.net 00:00:14.99] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) -[xUnit.net 00:00:14.99] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) -[xUnit.net 00:00:14.99] IL_000f: ldarg.0 -[xUnit.net 00:00:14.99] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) -[xUnit.net 00:00:14.99] IL_0015: pop -[xUnit.net 00:00:14.99] IL_0016: ret -[xUnit.net 00:00:14.99] } -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] .method public static void run() cil managed -[xUnit.net 00:00:14.99] { -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] .maxstack 6 -[xUnit.net 00:00:14.99] .locals init (native int V_0, -[xUnit.net 00:00:14.99] int32[] V_1, -[xUnit.net 00:00:14.99] int32& pinned V_2) -[xUnit.net 00:00:14.99] IL_0000: ldc.i4.3 -[xUnit.net 00:00:14.99] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:14.99] IL_0006: dup -[xUnit.net 00:00:14.99] IL_0007: ldc.i4.0 -[xUnit.net 00:00:14.99] IL_0008: ldc.i4.1 -[xUnit.net 00:00:14.99] IL_0009: stelem [runtime]System.Int32 -[xUnit.net 00:00:14.99] IL_000e: dup -[xUnit.net 00:00:14.99] IL_000f: ldc.i4.1 -[xUnit.net 00:00:14.99] IL_0010: ldc.i4.2 -[xUnit.net 00:00:14.99] IL_0011: stelem [runtime]System.Int32 -[xUnit.net 00:00:14.99] IL_0016: dup -[xUnit.net 00:00:14.99] IL_0017: ldc.i4.2 -[xUnit.net 00:00:14.99] IL_0018: ldc.i4.3 -[xUnit.net 00:00:14.99] IL_0019: stelem [runtime]System.Int32 -[xUnit.net 00:00:14.99] IL_001e: stloc.1 -[xUnit.net 00:00:14.99] IL_001f: ldloc.1 -[xUnit.net 00:00:14.99] IL_0020: brfalse.s IL_003c -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] IL_0022: ldloc.1 -[xUnit.net 00:00:14.99] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -[xUnit.net 00:00:14.99] IL_0028: brfalse.s IL_0037 -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] IL_002a: ldloc.1 -[xUnit.net 00:00:14.99] IL_002b: ldc.i4.0 -[xUnit.net 00:00:14.99] IL_002c: ldelema [runtime]System.Int32 -[xUnit.net 00:00:14.99] IL_0031: stloc.2 -[xUnit.net 00:00:14.99] IL_0032: ldloc.2 -[xUnit.net 00:00:14.99] IL_0033: conv.i -[xUnit.net 00:00:14.99] IL_0034: nop -[xUnit.net 00:00:14.99] IL_0035: br.s IL_003f -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] IL_0037: ldc.i4.0 -[xUnit.net 00:00:14.99] IL_0038: conv.i -[xUnit.net 00:00:14.99] IL_0039: nop -[xUnit.net 00:00:14.99] IL_003a: br.s IL_003f -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] IL_003c: ldc.i4.0 -[xUnit.net 00:00:14.99] IL_003d: conv.i -[xUnit.net 00:00:14.99] IL_003e: nop -[xUnit.net 00:00:14.99] IL_003f: stloc.0 -[xUnit.net 00:00:14.99] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:14.99] IL_0042: ldc.i4.5 -[xUnit.net 00:00:14.99] IL_0043: tail. -[xUnit.net 00:00:14.99] IL_0045: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:14.99] !!0) -[xUnit.net 00:00:14.99] IL_004a: ret -[xUnit.net 00:00:14.99] } -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] } -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 -[xUnit.net 00:00:14.99] extends [runtime]System.Object -[xUnit.net 00:00:14.99] { -[xUnit.net 00:00:14.99] } -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] -[xUnit.net 00:00:14.99] Stack Trace: -[xUnit.net 00:00:14.99] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:14.99] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:14.99] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:14.99] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() -[xUnit.net 00:00:14.99] at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) -[xUnit.net 00:00:14.99] at System.RuntimeMethodHandle.InvokeMethod(ObjectHandleOnStack target, Void** arguments, ObjectHandleOnStack sig, BOOL isConstructor, ObjectHandleOnStack result) -[xUnit.net 00:00:14.99] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) -[xUnit.net 00:00:14.99] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) -[xUnit.net 00:00:16.50] Finished: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:14.96] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx deleted file mode 100644 index ca22e81e3d8..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_03.trx +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.17] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.23] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.24] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.26] Finished: FSharp.Compiler.ComponentTests - - - - - No test matches the given testcase filter `FullyQualifiedName~'pinned locals'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx deleted file mode 100644 index 59db8a4ba64..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_18.trx +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.13] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.14] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.15] Finished: FSharp.Compiler.ComponentTests - - - - - No test matches the given testcase filter `FullyQualifiedName~'TailCall.*06'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx deleted file mode 100644 index 12ead895859..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_30_37.trx +++ /dev/null @@ -1,852 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Determining projects to restore... - Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/d1f29c8c-1181-4fbc-b611-b8f893cb95dc.tmp/ProjectFile.fsproj (in 80 ms). -/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/d1f29c8c-1181-4fbc-b611-b8f893cb95dc.tmp/ProjectFile.fsproj] - ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/d1f29c8c-1181-4fbc-b611-b8f893cb95dc.tmp/bin/Debug/net10.0/ProjectFile.dll - -Build succeeded. - 0 Warning(s) - 0 Error(s) - -Time Elapsed 00:00:02.51 - - - - - - - - - - - - - - - - - - - - - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0040: ldc.i4.s 42 -Actual: IL_0000: ldc.i4.3 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0042: ldc.i4.5 -Actual: IL_0001: newarr [runtime]System.Int32 -== - -== -Name: '.method public static void run() cil managed' - -Expected: IL_0043: call void TailCall06::foo<int32>(int32, -Actual: IL_0006: dup -== - -== -Name: '.method public static void run() cil managed' - -Expected: !!0) -Actual: IL_0007: ldc.i4.0 -== - -\Expected: -.method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: call void TailCall06::foo<int32>(int32, - !!0) - - - -Actual: -.method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - - -Entire actual: - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly 'assembly' -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.module 'assembly.dll' - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed TailCall06 - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static void foo<a>(int32 x, - !!a y) cil managed - { - - .maxstack 8 - IL_0000: ldstr "%d" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0015: pop - IL_0016: ret - } - - .method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.i4.1 - IL_0009: stelem [runtime]System.Int32 - IL_000e: dup - IL_000f: ldc.i4.1 - IL_0010: ldc.i4.2 - IL_0011: stelem [runtime]System.Int32 - IL_0016: dup - IL_0017: ldc.i4.2 - IL_0018: ldc.i4.3 - IL_0019: stelem [runtime]System.Int32 - IL_001e: stloc.1 - IL_001f: ldloc.1 - IL_0020: brfalse.s IL_003c - - IL_0022: ldloc.1 - IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) - IL_0028: brfalse.s IL_0037 - - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: ldelema [runtime]System.Int32 - IL_0031: stloc.2 - IL_0032: ldloc.2 - IL_0033: conv.i - IL_0034: nop - IL_0035: br.s IL_003f - - IL_0037: ldc.i4.0 - IL_0038: conv.i - IL_0039: nop - IL_003a: br.s IL_003f - - IL_003c: ldc.i4.0 - IL_003d: conv.i - IL_003e: nop - IL_003f: stloc.0 - IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: tail. - IL_0045: call void TailCall06::foo<int32>(int32, - !!0) - IL_004a: ret - } - -} - -.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 - extends [runtime]System.Object -{ -} - - - - - - - at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 - at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 - at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) - at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 - at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) - at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.14] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.16] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:09.47] -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] Expected: IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:09.48] Actual: IL_0000: ldc.i4.3 -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] Expected: IL_0042: ldc.i4.5 -[xUnit.net 00:00:09.48] Actual: IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] Expected: IL_0043: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.48] Actual: IL_0006: dup -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] Name: '.method public static void run() cil managed' -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] Expected: !!0) -[xUnit.net 00:00:09.48] Actual: IL_0007: ldc.i4.0 -[xUnit.net 00:00:09.48] == -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] \Expected: -[xUnit.net 00:00:09.48] .method public static void run() cil managed -[xUnit.net 00:00:09.48] { -[xUnit.net 00:00:09.48] -[xUnit.net 00:00:09.48] .maxstack 6 -[xUnit.net 00:00:09.48] .locals init (native int V_0, -[xUnit.net 00:00:09.48] int32[] V_1, -[xUnit.net 00:00:09.48] int32& pinned V_2) -[xUnit.net 00:00:09.48] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:09.49] IL_0042: ldc.i4.5 -[xUnit.net 00:00:09.49] IL_0043: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.49] !!0) -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] Actual: -[xUnit.net 00:00:09.49] .method public static void run() cil managed -[xUnit.net 00:00:09.49] { -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .maxstack 6 -[xUnit.net 00:00:09.49] .locals init (native int V_0, -[xUnit.net 00:00:09.49] int32[] V_1, -[xUnit.net 00:00:09.49] int32& pinned V_2) -[xUnit.net 00:00:09.49] IL_0000: ldc.i4.3 -[xUnit.net 00:00:09.49] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:09.49] IL_0006: dup -[xUnit.net 00:00:09.49] IL_0007: ldc.i4.0 -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] Entire actual: -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .assembly extern runtime { } -[xUnit.net 00:00:09.49] .assembly extern FSharp.Core { } -[xUnit.net 00:00:09.49] .assembly 'assembly' -[xUnit.net 00:00:09.49] { -[xUnit.net 00:00:09.49] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, -[xUnit.net 00:00:09.49] int32, -[xUnit.net 00:00:09.49] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .hash algorithm 0x00008004 -[xUnit.net 00:00:09.49] .ver 0:0:0:0 -[xUnit.net 00:00:09.49] } -[xUnit.net 00:00:09.49] .module 'assembly.dll' -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .imagebase {value} -[xUnit.net 00:00:09.49] .file alignment 0x00000200 -[xUnit.net 00:00:09.49] .stackreserve 0x00100000 -[xUnit.net 00:00:09.49] .subsystem 0x0003 -[xUnit.net 00:00:09.49] .corflags 0x00000001 -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .class public abstract auto ansi sealed TailCall06 -[xUnit.net 00:00:09.49] extends [runtime]System.Object -[xUnit.net 00:00:09.49] { -[xUnit.net 00:00:09.49] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) -[xUnit.net 00:00:09.49] .method public static void foo<a>(int32 x, -[xUnit.net 00:00:09.49] !!a y) cil managed -[xUnit.net 00:00:09.49] { -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .maxstack 8 -[xUnit.net 00:00:09.49] IL_0000: ldstr "%d" -[xUnit.net 00:00:09.49] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) -[xUnit.net 00:00:09.49] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) -[xUnit.net 00:00:09.49] IL_000f: ldarg.0 -[xUnit.net 00:00:09.49] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) -[xUnit.net 00:00:09.49] IL_0015: pop -[xUnit.net 00:00:09.49] IL_0016: ret -[xUnit.net 00:00:09.49] } -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .method public static void run() cil managed -[xUnit.net 00:00:09.49] { -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] .maxstack 6 -[xUnit.net 00:00:09.49] .locals init (native int V_0, -[xUnit.net 00:00:09.49] int32[] V_1, -[xUnit.net 00:00:09.49] int32& pinned V_2) -[xUnit.net 00:00:09.49] IL_0000: ldc.i4.3 -[xUnit.net 00:00:09.49] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:09.49] IL_0006: dup -[xUnit.net 00:00:09.49] IL_0007: ldc.i4.0 -[xUnit.net 00:00:09.49] IL_0008: ldc.i4.1 -[xUnit.net 00:00:09.49] IL_0009: stelem [runtime]System.Int32 -[xUnit.net 00:00:09.49] IL_000e: dup -[xUnit.net 00:00:09.49] IL_000f: ldc.i4.1 -[xUnit.net 00:00:09.49] IL_0010: ldc.i4.2 -[xUnit.net 00:00:09.49] IL_0011: stelem [runtime]System.Int32 -[xUnit.net 00:00:09.49] IL_0016: dup -[xUnit.net 00:00:09.49] IL_0017: ldc.i4.2 -[xUnit.net 00:00:09.49] IL_0018: ldc.i4.3 -[xUnit.net 00:00:09.49] IL_0019: stelem [runtime]System.Int32 -[xUnit.net 00:00:09.49] IL_001e: stloc.1 -[xUnit.net 00:00:09.49] IL_001f: ldloc.1 -[xUnit.net 00:00:09.49] IL_0020: brfalse.s IL_003c -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] IL_0022: ldloc.1 -[xUnit.net 00:00:09.49] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -[xUnit.net 00:00:09.49] IL_0028: brfalse.s IL_0037 -[xUnit.net 00:00:09.49] -[xUnit.net 00:00:09.49] IL_002a: ldloc.1 -[xUnit.net 00:00:09.49] IL_002b: ldc.i4.0 -[xUnit.net 00:00:09.49] IL_002c: ldelema [runtime]System.Int32 -[xUnit.net 00:00:09.49] IL_0031: stloc.2 -[xUnit.net 00:00:09.49] IL_0032: ldloc.2 -[xUnit.net 00:00:09.50] IL_0033: conv.i -[xUnit.net 00:00:09.50] IL_0034: nop -[xUnit.net 00:00:09.50] IL_0035: br.s IL_003f -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] IL_0037: ldc.i4.0 -[xUnit.net 00:00:09.50] IL_0038: conv.i -[xUnit.net 00:00:09.50] IL_0039: nop -[xUnit.net 00:00:09.50] IL_003a: br.s IL_003f -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] IL_003c: ldc.i4.0 -[xUnit.net 00:00:09.50] IL_003d: conv.i -[xUnit.net 00:00:09.50] IL_003e: nop -[xUnit.net 00:00:09.50] IL_003f: stloc.0 -[xUnit.net 00:00:09.50] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:09.50] IL_0042: ldc.i4.5 -[xUnit.net 00:00:09.50] IL_0043: tail. -[xUnit.net 00:00:09.50] IL_0045: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.50] !!0) -[xUnit.net 00:00:09.50] IL_004a: ret -[xUnit.net 00:00:09.50] } -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] } -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 -[xUnit.net 00:00:09.50] extends [runtime]System.Object -[xUnit.net 00:00:09.50] { -[xUnit.net 00:00:09.50] } -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] -[xUnit.net 00:00:09.50] Stack Trace: -[xUnit.net 00:00:09.50] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:09.50] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:09.50] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:09.50] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() -[xUnit.net 00:00:09.50] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) -[xUnit.net 00:00:09.50] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) -[xUnit.net 00:00:16.66] Finished: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:09.47] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx deleted file mode 100644 index 8513a84ca60..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_31_54.trx +++ /dev/null @@ -1,832 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - -== -Name: 'IL_0040: ldc.i4.s 42' - -Expected: IL_0043: call void TailCall06::foo<int32>(int32, -Actual: IL_0043: tail. -== - -== -Name: 'IL_0040: ldc.i4.s 42' - -Expected: !!0) -Actual: IL_0045: call void TailCall06::foo<int32>(int32, -== - -== -Name: 'IL_0040: ldc.i4.s 42' - -Expected: IL_0048: nop -Actual: !!0) -== - -== -Name: 'IL_0040: ldc.i4.s 42' - -Expected: IL_0049: ldc.i4.0 -Actual: IL_004a: ret -== - -\Expected: -IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: call void TailCall06::foo<int32>(int32, - !!0) - IL_0048: nop - IL_0049: ldc.i4.0 - - - -Actual: -IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: tail. - IL_0045: call void TailCall06::foo<int32>(int32, - !!0) - IL_004a: ret - - -Entire actual: - - - - - -.assembly extern runtime { } -.assembly extern FSharp.Core { } -.assembly assembly -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, - int32, - int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) - - - - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.module assembly.dll - -.imagebase {value} -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 -.corflags 0x00000001 - - - - - -.class public abstract auto ansi sealed TailCall06 - extends [runtime]System.Object -{ - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) - .method public static void foo<a>(int32 x, - !!a y) cil managed - { - - .maxstack 8 - IL_0000: ldstr "%d" - IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) - IL_000f: ldarg.0 - IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) - IL_0015: pop - IL_0016: ret - } - - .method public static void run() cil managed - { - - .maxstack 6 - .locals init (native int V_0, - int32[] V_1, - int32& pinned V_2) - IL_0000: ldc.i4.3 - IL_0001: newarr [runtime]System.Int32 - IL_0006: dup - IL_0007: ldc.i4.0 - IL_0008: ldc.i4.1 - IL_0009: stelem [runtime]System.Int32 - IL_000e: dup - IL_000f: ldc.i4.1 - IL_0010: ldc.i4.2 - IL_0011: stelem [runtime]System.Int32 - IL_0016: dup - IL_0017: ldc.i4.2 - IL_0018: ldc.i4.3 - IL_0019: stelem [runtime]System.Int32 - IL_001e: stloc.1 - IL_001f: ldloc.1 - IL_0020: brfalse.s IL_003c - - IL_0022: ldloc.1 - IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) - IL_0028: brfalse.s IL_0037 - - IL_002a: ldloc.1 - IL_002b: ldc.i4.0 - IL_002c: ldelema [runtime]System.Int32 - IL_0031: stloc.2 - IL_0032: ldloc.2 - IL_0033: conv.i - IL_0034: nop - IL_0035: br.s IL_003f - - IL_0037: ldc.i4.0 - IL_0038: conv.i - IL_0039: nop - IL_003a: br.s IL_003f - - IL_003c: ldc.i4.0 - IL_003d: conv.i - IL_003e: nop - IL_003f: stloc.0 - IL_0040: ldc.i4.s 42 - IL_0042: ldc.i4.5 - IL_0043: tail. - IL_0045: call void TailCall06::foo<int32>(int32, - !!0) - IL_004a: ret - } - -} - -.class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 - extends [runtime]System.Object -{ -} - - - - - - - at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 184 - at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) in /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs:line 192 - at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) - at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() in /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs:line 249 - at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) - at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Determining projects to restore... - Restored /home/runner/work/fsharp/fsharp/artifacts/Temp/2971f6e9-bc86-46e7-925a-e73152ad35f5.tmp/ProjectFile.fsproj (in 78 ms). -/usr/share/dotnet/sdk/10.0.100-rc.1.25411.109/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.RuntimeIdentifierInference.targets(345,5): message NETSDK1057: You are using a preview version of .NET. See: https://aka.ms/dotnet-support-policy [/home/runner/work/fsharp/fsharp/artifacts/Temp/2971f6e9-bc86-46e7-925a-e73152ad35f5.tmp/ProjectFile.fsproj] - ProjectFile -> /home/runner/work/fsharp/fsharp/artifacts/Temp/2971f6e9-bc86-46e7-925a-e73152ad35f5.tmp/bin/Debug/net10.0/ProjectFile.dll - -Build succeeded. - 0 Warning(s) - 0 Error(s) - -Time Elapsed 00:00:02.51 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.14] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.15] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] Expected: IL_0043: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.70] Actual: IL_0043: tail. -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] Expected: !!0) -[xUnit.net 00:00:09.70] Actual: IL_0045: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] Expected: IL_0048: nop -[xUnit.net 00:00:09.70] Actual: !!0) -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] Name: 'IL_0040: ldc.i4.s 42' -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] Expected: IL_0049: ldc.i4.0 -[xUnit.net 00:00:09.70] Actual: IL_004a: ret -[xUnit.net 00:00:09.70] == -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] \Expected: -[xUnit.net 00:00:09.70] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:09.70] IL_0042: ldc.i4.5 -[xUnit.net 00:00:09.70] IL_0043: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.70] !!0) -[xUnit.net 00:00:09.70] IL_0048: nop -[xUnit.net 00:00:09.70] IL_0049: ldc.i4.0 -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] Actual: -[xUnit.net 00:00:09.70] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:09.70] IL_0042: ldc.i4.5 -[xUnit.net 00:00:09.70] IL_0043: tail. -[xUnit.net 00:00:09.70] IL_0045: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.70] !!0) -[xUnit.net 00:00:09.70] IL_004a: ret -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] Entire actual: -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .assembly extern runtime { } -[xUnit.net 00:00:09.70] .assembly extern FSharp.Core { } -[xUnit.net 00:00:09.70] .assembly assembly -[xUnit.net 00:00:09.70] { -[xUnit.net 00:00:09.70] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32, -[xUnit.net 00:00:09.70] int32, -[xUnit.net 00:00:09.70] int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 ) -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .hash algorithm 0x00008004 -[xUnit.net 00:00:09.70] .ver 0:0:0:0 -[xUnit.net 00:00:09.70] } -[xUnit.net 00:00:09.70] .module assembly.dll -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .imagebase {value} -[xUnit.net 00:00:09.70] .file alignment 0x00000200 -[xUnit.net 00:00:09.70] .stackreserve 0x00100000 -[xUnit.net 00:00:09.70] .subsystem 0x0003 -[xUnit.net 00:00:09.70] .corflags 0x00000001 -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .class public abstract auto ansi sealed TailCall06 -[xUnit.net 00:00:09.70] extends [runtime]System.Object -[xUnit.net 00:00:09.70] { -[xUnit.net 00:00:09.70] .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 07 00 00 00 00 00 ) -[xUnit.net 00:00:09.70] .method public static void foo<a>(int32 x, -[xUnit.net 00:00:09.70] !!a y) cil managed -[xUnit.net 00:00:09.70] { -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .maxstack 8 -[xUnit.net 00:00:09.70] IL_0000: ldstr "%d" -[xUnit.net 00:00:09.70] IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) -[xUnit.net 00:00:09.70] IL_000a: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine<class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>) -[xUnit.net 00:00:09.70] IL_000f: ldarg.0 -[xUnit.net 00:00:09.70] IL_0010: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<int32,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::Invoke(!0) -[xUnit.net 00:00:09.70] IL_0015: pop -[xUnit.net 00:00:09.70] IL_0016: ret -[xUnit.net 00:00:09.70] } -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .method public static void run() cil managed -[xUnit.net 00:00:09.70] { -[xUnit.net 00:00:09.70] -[xUnit.net 00:00:09.70] .maxstack 6 -[xUnit.net 00:00:09.70] .locals init (native int V_0, -[xUnit.net 00:00:09.70] int32[] V_1, -[xUnit.net 00:00:09.71] int32& pinned V_2) -[xUnit.net 00:00:09.71] IL_0000: ldc.i4.3 -[xUnit.net 00:00:09.71] IL_0001: newarr [runtime]System.Int32 -[xUnit.net 00:00:09.71] IL_0006: dup -[xUnit.net 00:00:09.71] IL_0007: ldc.i4.0 -[xUnit.net 00:00:09.71] IL_0008: ldc.i4.1 -[xUnit.net 00:00:09.71] IL_0009: stelem [runtime]System.Int32 -[xUnit.net 00:00:09.71] IL_000e: dup -[xUnit.net 00:00:09.71] IL_000f: ldc.i4.1 -[xUnit.net 00:00:09.71] IL_0010: ldc.i4.2 -[xUnit.net 00:00:09.71] IL_0011: stelem [runtime]System.Int32 -[xUnit.net 00:00:09.71] IL_0016: dup -[xUnit.net 00:00:09.71] IL_0017: ldc.i4.2 -[xUnit.net 00:00:09.71] IL_0018: ldc.i4.3 -[xUnit.net 00:00:09.71] IL_0019: stelem [runtime]System.Int32 -[xUnit.net 00:00:09.71] IL_001e: stloc.1 -[xUnit.net 00:00:09.71] IL_001f: ldloc.1 -[xUnit.net 00:00:09.71] IL_0020: brfalse.s IL_003c -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] IL_0022: ldloc.1 -[xUnit.net 00:00:09.71] IL_0023: call int32 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Length<int32>(!!0[]) -[xUnit.net 00:00:09.71] IL_0028: brfalse.s IL_0037 -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] IL_002a: ldloc.1 -[xUnit.net 00:00:09.71] IL_002b: ldc.i4.0 -[xUnit.net 00:00:09.71] IL_002c: ldelema [runtime]System.Int32 -[xUnit.net 00:00:09.71] IL_0031: stloc.2 -[xUnit.net 00:00:09.71] IL_0032: ldloc.2 -[xUnit.net 00:00:09.71] IL_0033: conv.i -[xUnit.net 00:00:09.71] IL_0034: nop -[xUnit.net 00:00:09.71] IL_0035: br.s IL_003f -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] IL_0037: ldc.i4.0 -[xUnit.net 00:00:09.71] IL_0038: conv.i -[xUnit.net 00:00:09.71] IL_0039: nop -[xUnit.net 00:00:09.71] IL_003a: br.s IL_003f -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] IL_003c: ldc.i4.0 -[xUnit.net 00:00:09.71] IL_003d: conv.i -[xUnit.net 00:00:09.71] IL_003e: nop -[xUnit.net 00:00:09.71] IL_003f: stloc.0 -[xUnit.net 00:00:09.71] IL_0040: ldc.i4.s 42 -[xUnit.net 00:00:09.71] IL_0042: ldc.i4.5 -[xUnit.net 00:00:09.71] IL_0043: tail. -[xUnit.net 00:00:09.71] IL_0045: call void TailCall06::foo<int32>(int32, -[xUnit.net 00:00:09.71] !!0) -[xUnit.net 00:00:09.71] IL_004a: ret -[xUnit.net 00:00:09.71] } -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] } -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] .class private abstract auto ansi sealed '<StartupCode$assembly>'.$TailCall06 -[xUnit.net 00:00:09.71] extends [runtime]System.Object -[xUnit.net 00:00:09.71] { -[xUnit.net 00:00:09.71] } -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] -[xUnit.net 00:00:09.71] Stack Trace: -[xUnit.net 00:00:09.72] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(184,0): at FSharp.Test.ILChecker.checkILAux(IEnumerable`1 ildasmArgs, String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:09.72] /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/ILChecker.fs(192,0): at FSharp.Test.ILChecker.checkIL(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:09.72] at FSharp.Test.Compiler.verifyIL@1374.Invoke(String dllFilePath, FSharpList`1 expectedIL) -[xUnit.net 00:00:09.72] /home/runner/work/fsharp/fsharp/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs(249,0): at EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals() -[xUnit.net 00:00:09.72] at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) -[xUnit.net 00:00:09.72] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) -[xUnit.net 00:00:16.90] Finished: FSharp.Compiler.ComponentTests - - - - - [xUnit.net 00:00:09.70] EmittedIL.Tail Calls.TailCall 06 - No tail call with pinned locals [FAIL] - - - - \ No newline at end of file diff --git a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx b/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx deleted file mode 100644 index 2df244fe411..00000000000 --- a/TestResults/_pkrvm7jw40e0xgp_2025-09-08_16_36_48.trx +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - [xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.8.2+699d445a1a (64-bit .NET 10.0.0-rc.1.25411.109) -Installing TestConsole redirection ---------------------------------------------------------------- -Executables -CSC = /home/runner/.nuget/packages/microsoft.net.compilers/4.3.0-1.22220.8/tools/csc.exe -BUILD_CONFIG = Release -csc_flags = /nologo -FSC = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsc/Release/net10.0/fsc.dll -fsc_flags = -r:System.Core.dll --nowarn:20 --define:COMPILED --preferreduilang:en-US -FSCOREDLLPATH = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/FSharp.Core/Release/netstandard2.0/FSharp.Core.dll -FSI = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -DotNetExe = dotnet -DOTNET_MULTILEVEL_LOOKUP = 0 -DOTNET_ROOT = /usr/share/dotnet -FSI_FOR_SCRIPTS = /home/runner/work/fsharp/fsharp/tests/FSharp.Test.Utilities/../../artifacts/bin/fsi/Release/net10.0/fsi.dll -fsi_flags = -r:System.Core.dll --nowarn:20 --define:INTERACTIVE --maxerrors:1 --abortonerror --preferreduilang:en-US -ILDASM = /home/runner/.nuget/packages/runtime.linux-x64.microsoft.netcore.ildasm/5.0.0-preview.7.20364.11/runtimes/linux-x64/native/ildasm -PEVERIFY = ilverify ---------------------------------------------------------------- -[xUnit.net 00:00:00.16] Discovering: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.16] Discovered: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.17] Starting: FSharp.Compiler.ComponentTests -[xUnit.net 00:00:01.19] Finished: FSharp.Compiler.ComponentTests - - - - - No test matches the given testcase filter `DisplayName~'TailCall 06'` in /home/runner/work/fsharp/fsharp/artifacts/bin/FSharp.Compiler.ComponentTests/Release/net10.0/FSharp.Compiler.ComponentTests.dll - - - - \ No newline at end of file diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 7f5ab7289d2..569646fc0ce 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,5 +1,6 @@ ### Fixed * Fix missing TailCall warning in TOp.IntegerForLoop ([PR #18399](https://github.com/dotnet/fsharp/pull/18399)) +* Fix F# compiler to prevent tail call emission when pinned locals are present ([PR #XXXX](https://github.com/dotnet/fsharp/pull/XXXX)) * Fix classification of `nameof` in `nameof<'T>`, `match … with nameof ident -> …`. ([Issue #10026](https://github.com/dotnet/fsharp/issues/10026), [PR #18300](https://github.com/dotnet/fsharp/pull/18300)) * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix optimizer internal error for records with static fields ([Issue #18165](https://github.com/dotnet/fsharp/issues/18165), [PR #18280](https://github.com/dotnet/fsharp/pull/18280)) diff --git a/src/Compiler/Checking/TailCallChecks.fs b/src/Compiler/Checking/TailCallChecks.fs index d6d7205d9ec..bb4bebbcf98 100644 --- a/src/Compiler/Checking/TailCallChecks.fs +++ b/src/Compiler/Checking/TailCallChecks.fs @@ -744,12 +744,15 @@ and CheckBinding cenv alwaysCheckNoReraise ctxt (TBind(v, bindRhs, _) as bind) : CheckLambdas isTop (Some v) cenv v.ShouldInline valReprInfo tailCall alwaysCheckNoReraise bindRhs v.Range v.Type ctxt and CheckBindings cenv binds = - let mutable currentCenv = cenv for bind in binds do let (TBind(v, _, _)) = bind // Update the environment if this binding is fixed - if v.IsFixed then - currentCenv <- { currentCenv with hasPinnedLocals = true } + let currentCenv = + if v.IsFixed then + { cenv with hasPinnedLocals = true } + else + cenv + CheckBinding currentCenv false PermitByRefExpr.Yes bind let CheckModuleBinding cenv (isRec: bool) (TBind _ as bind) = diff --git a/src/Compiler/CodeGen/IlxGen.fs b/src/Compiler/CodeGen/IlxGen.fs index 0ecb4142d03..32b04b8c90f 100644 --- a/src/Compiler/CodeGen/IlxGen.fs +++ b/src/Compiler/CodeGen/IlxGen.fs @@ -4495,6 +4495,7 @@ and CanTailcall // Can't tailcall with a .NET 2.0 generic constrained call since it involves a byref // Can't tailcall when there are pinned locals since the stack frame must remain alive let hasPinnedLocals = cgbuf.HasPinnedLocals() + if not hasStructObjArg && Option.isNone ccallInfo diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs index 021f87dcede..0ab38dcc41e 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/TailCalls.fs @@ -255,3 +255,24 @@ let run() = """ ] + [] + let ``TailCall 07 - No tail call with pinned locals in recursive function``() = + FSharp """ +module TailCall07 +let rec countdown n = + use ptr = fixed [| n |] + if n <= 0 then + 0 + else + countdown (n - 1) + """ + |> compileWithTailCalls + |> shouldSucceed + |> verifyIL [ + """ +.locals init (native int V_0, + int32[] V_1, + int32& pinned V_2) + """ + ] + From b4edc34c578a0dc432af791c8e251a9d77d45167 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 18 Sep 2025 08:35:25 +0000 Subject: [PATCH 6/6] Move release notes from 9.0.300 to 10.0.100 as requested Co-authored-by: T-Gro <46543583+T-Gro@users.noreply.github.com> --- docs/release-notes/.FSharp.Compiler.Service/10.0.100.md | 1 + docs/release-notes/.FSharp.Compiler.Service/9.0.300.md | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md index 06b39cc019d..208c34fcc3b 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md +++ b/docs/release-notes/.FSharp.Compiler.Service/10.0.100.md @@ -7,6 +7,7 @@ ### Fixed +* Fix F# compiler to prevent tail call emission when pinned locals are present ([PR #XXXX](https://github.com/dotnet/fsharp/pull/XXXX)) * Fix SignatureHash to include constant values in hash computation ([Issue #18758](https://github.com/dotnet/fsharp/issues/18758)) * Fix parsing errors using anonymous records and units of measures ([PR #18543](https://github.com/dotnet/fsharp/pull/18543)) * Fix parsing errors using anonymous records and code quotations ([PR #18603](https://github.com/dotnet/fsharp/pull/18603)) diff --git a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md index 569646fc0ce..7f5ab7289d2 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/9.0.300.md @@ -1,6 +1,5 @@ ### Fixed * Fix missing TailCall warning in TOp.IntegerForLoop ([PR #18399](https://github.com/dotnet/fsharp/pull/18399)) -* Fix F# compiler to prevent tail call emission when pinned locals are present ([PR #XXXX](https://github.com/dotnet/fsharp/pull/XXXX)) * Fix classification of `nameof` in `nameof<'T>`, `match … with nameof ident -> …`. ([Issue #10026](https://github.com/dotnet/fsharp/issues/10026), [PR #18300](https://github.com/dotnet/fsharp/pull/18300)) * Fix Realsig+ generates nested closures with incorrect Generic ([Issue #17797](https://github.com/dotnet/fsharp/issues/17797), [PR #17877](https://github.com/dotnet/fsharp/pull/17877)) * Fix optimizer internal error for records with static fields ([Issue #18165](https://github.com/dotnet/fsharp/issues/18165), [PR #18280](https://github.com/dotnet/fsharp/pull/18280))