From f562133c5c0852d3c3e6547846c6c0a58f7a60e1 Mon Sep 17 00:00:00 2001 From: Brian Rourke Boll Date: Mon, 17 Feb 2025 12:41:12 -0500 Subject: [PATCH] Add for-loop tests & baselines --- .../EmittedIL/ForLoop/ForLoop.fs | 96 + .../EmittedIL/ForLoop/ForLoopBigInt.fs | 59 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 1428 +++++++++++++++ .../EmittedIL/ForLoop/ForLoopByte.fs | 30 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 405 +++++ .../EmittedIL/ForLoop/ForLoopChar.fs | 30 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 405 +++++ .../EmittedIL/ForLoop/ForLoopInt16.fs | 59 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 705 +++++++ .../EmittedIL/ForLoop/ForLoopInt32.fs | 83 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 658 +++++++ .../EmittedIL/ForLoop/ForLoopInt64.fs | 59 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 1088 +++++++++++ .../EmittedIL/ForLoop/ForLoopIntPtr.fs | 59 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 1618 +++++++++++++++++ .../EmittedIL/ForLoop/ForLoopSByte.fs | 59 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 705 +++++++ .../EmittedIL/ForLoop/ForLoopUInt16.fs | 30 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 405 +++++ .../EmittedIL/ForLoop/ForLoopUInt32.fs | 30 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 428 +++++ .../EmittedIL/ForLoop/ForLoopUInt64.fs | 30 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 597 ++++++ .../EmittedIL/ForLoop/ForLoopUIntPtr.fs | 30 + ....RealInternalSignatureOn.OptimizeOn.il.bsl | 771 ++++++++ 25 files changed, 9867 insertions(+) create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs create mode 100644 tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs index a12316477a9..10690aab5cc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoop.fs @@ -217,3 +217,99 @@ module ForLoop = compilation |> getCompilation |> verifyCompilation + + // SOURCE=ForLoopSByte.fs SCFLAGS="--optimize+" # ForLoopSByte.fs --optimize+ + [] + let ``ForLoopSByte_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopByte.fs SCFLAGS="--optimize+" # ForLoopByte.fs --optimize+ + [] + let ``ForLoopByte_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopChar.fs SCFLAGS="--optimize+" # ForLoopChar.fs --optimize+ + [] + let ``ForLoopChar_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopInt16.fs SCFLAGS="--optimize+" # ForLoopInt16.fs --optimize+ + [] + let ``ForLoopInt16_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopUInt16.fs SCFLAGS="--optimize+" # ForLoopUInt16.fs --optimize+ + [] + let ``ForLoopUInt16_`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopInt32.fs SCFLAGS="--optimize+" # ForLoopInt32.fs --optimize+ + [] + let ``ForLoopInt32_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopUInt32.fs SCFLAGS="--optimize+" # ForLoopUInt32.fs --optimize+ + [] + let ``ForLoopUInt32_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopInt64.fs SCFLAGS="--optimize+" # ForLoopInt64.fs --optimize+ + [] + let ``ForLoopInt64_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopUInt64.fs SCFLAGS="--optimize+" # ForLoopUInt64.fs --optimize+ + [] + let ``ForLoopUInt64_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopIntPtr.fs SCFLAGS="--optimize+" # ForLoopIntPtr.fs --optimize+ + [] + let ``ForLoopIntPtr_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopUIntPtr.fs SCFLAGS="--optimize+" # ForLoopUIntPtr.fs --optimize+ + [] + let ``ForLoopUIntPtr_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation + + // SOURCE=ForLoopBigInt.fs SCFLAGS="--optimize+" # ForLoopBigInt.fs --optimize+ + [] + let ``ForLoopBigInt_fs`` compilation = + compilation + |> getCompilation + |> withLangVersionPreview + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs new file mode 100644 index 00000000000..c91b07c45ba --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs @@ -0,0 +1,59 @@ +let mutable c = 0I + +module Up = + let constEmpty () = + for n = 10I to 1I do + c <- n + + let constNonEmpty () = + for n = 1I to 10I do + c <- n + + let constFinish start = + for n = start to 10I do + c <- n + + let constStart finish = + for n = 1I to finish do + c <- n + + let annotatedStart (start: bigint) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: bigint) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n + +module Down = + let constEmpty () = + for n = 1I downto 10I do + c <- n + + let constNonEmpty () = + for n = 10I downto 1I do + c <- n + + let constFinish start = + for n = start downto 1I do + c <- n + + let constStart finish = + for n = 10I downto finish do + c <- n + + let annotatedStart (start: bigint) finish = + for n = start downto finish do + c <- n + + let annotatedFinish start (finish: bigint) = + for n = start downto finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start downto finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..33dd4637b0e --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopBigInt.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,1428 @@ + + + + + +.assembly extern runtime { } +.assembly extern FSharp.Core { } +.assembly extern System.Numerics +{ + .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) + .ver 4:0:0:0 +} +.assembly extern netstandard +{ + .publickeytoken = (CC 7B 13 FF CD 2D DD 51 ) + .ver 2:1:0:0 +} +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Down + 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 ) + .class auto ansi serializable sealed nested assembly beforefieldinit 'constEmpty@34-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'constEmpty@34-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'constEmpty@34-1'::.ctor() + IL_0005: stsfld class assembly/Down/'constEmpty@34-1' assembly/Down/'constEmpty@34-1'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'constNonEmpty@38-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'constNonEmpty@38-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'constNonEmpty@38-1'::.ctor() + IL_0005: stsfld class assembly/Down/'constNonEmpty@38-1' assembly/Down/'constNonEmpty@38-1'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'constFinish@42-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'constFinish@42-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'constFinish@42-1'::.ctor() + IL_0005: stsfld class assembly/Down/'constFinish@42-1' assembly/Down/'constFinish@42-1'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'constStart@46-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'constStart@46-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'constStart@46-1'::.ctor() + IL_0005: stsfld class assembly/Down/'constStart@46-1' assembly/Down/'constStart@46-1'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'annotatedStart@50-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'annotatedStart@50-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'annotatedStart@50-1'::.ctor() + IL_0005: stsfld class assembly/Down/'annotatedStart@50-1' assembly/Down/'annotatedStart@50-1'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'annotatedFinish@54-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'annotatedFinish@54-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'annotatedFinish@54-1'::.ctor() + IL_0005: stsfld class assembly/Down/'annotatedFinish@54-1' assembly/Down/'annotatedFinish@54-1'::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit 'inferredStartAndFinish@58-1' + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Down/'inferredStartAndFinish@58-1' @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Down/'inferredStartAndFinish@58-1'::.ctor() + IL_0005: stsfld class assembly/Down/'inferredStartAndFinish@58-1' assembly/Down/'inferredStartAndFinish@58-1'::@_instance + IL_000a: ret + } + + } + + .method public static void constEmpty() cil managed + { + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + valuetype [System.Numerics]System.Numerics.BigInteger V_2, + valuetype [System.Numerics]System.Numerics.BigInteger V_3, + class [runtime]System.Collections.Generic.IEnumerator`1 V_4, + class [runtime]System.IDisposable V_5) + IL_0000: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_One() + IL_0005: stloc.1 + IL_0006: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_000b: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0010: stloc.2 + IL_0011: ldc.i4.s 10 + IL_0013: newobj instance void [netstandard]System.Numerics.BigInteger::.ctor(int32) + IL_0018: stloc.3 + IL_0019: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_001e: ldsfld class assembly/Down/'constEmpty@34-1' assembly/Down/'constEmpty@34-1'::@_instance + IL_0023: ldloc.1 + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_002b: stloc.0 + IL_002c: ldloc.0 + IL_002d: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0032: stloc.s V_4 + .try + { + IL_0034: br.s IL_0042 + + IL_0036: ldloc.s V_4 + IL_0038: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_003d: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0042: ldloc.s V_4 + IL_0044: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0049: brtrue.s IL_0036 + + IL_004b: leave.s IL_0063 + + } + finally + { + IL_004d: ldloc.s V_4 + IL_004f: isinst [runtime]System.IDisposable + IL_0054: stloc.s V_5 + IL_0056: ldloc.s V_5 + IL_0058: brfalse.s IL_0062 + + IL_005a: ldloc.s V_5 + IL_005c: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0061: endfinally + IL_0062: endfinally + } + IL_0063: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + valuetype [System.Numerics]System.Numerics.BigInteger V_2, + valuetype [System.Numerics]System.Numerics.BigInteger V_3, + class [runtime]System.Collections.Generic.IEnumerator`1 V_4, + class [runtime]System.IDisposable V_5) + IL_0000: ldc.i4.s 10 + IL_0002: newobj instance void [netstandard]System.Numerics.BigInteger::.ctor(int32) + IL_0007: stloc.1 + IL_0008: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_000d: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0012: stloc.2 + IL_0013: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_One() + IL_0018: stloc.3 + IL_0019: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_001e: ldsfld class assembly/Down/'constNonEmpty@38-1' assembly/Down/'constNonEmpty@38-1'::@_instance + IL_0023: ldloc.1 + IL_0024: ldloc.2 + IL_0025: ldloc.3 + IL_0026: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_002b: stloc.0 + IL_002c: ldloc.0 + IL_002d: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0032: stloc.s V_4 + .try + { + IL_0034: br.s IL_0042 + + IL_0036: ldloc.s V_4 + IL_0038: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_003d: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0042: ldloc.s V_4 + IL_0044: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0049: brtrue.s IL_0036 + + IL_004b: leave.s IL_0063 + + } + finally + { + IL_004d: ldloc.s V_4 + IL_004f: isinst [runtime]System.IDisposable + IL_0054: stloc.s V_5 + IL_0056: ldloc.s V_5 + IL_0058: brfalse.s IL_0062 + + IL_005a: ldloc.s V_5 + IL_005c: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0061: endfinally + IL_0062: endfinally + } + IL_0063: ret + } + + .method public static void constFinish(valuetype [System.Numerics]System.Numerics.BigInteger start) cil managed + { + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + valuetype [System.Numerics]System.Numerics.BigInteger V_2, + class [runtime]System.Collections.Generic.IEnumerator`1 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_000a: stloc.1 + IL_000b: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_One() + IL_0010: stloc.2 + IL_0011: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_0016: ldsfld class assembly/Down/'constFinish@42-1' assembly/Down/'constFinish@42-1'::@_instance + IL_001b: ldarg.0 + IL_001c: ldloc.1 + IL_001d: ldloc.2 + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_0023: stloc.0 + IL_0024: ldloc.0 + IL_0025: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_002a: stloc.3 + .try + { + IL_002b: br.s IL_0038 + + IL_002d: ldloc.3 + IL_002e: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0033: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0038: ldloc.3 + IL_0039: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003e: brtrue.s IL_002d + + IL_0040: leave.s IL_0057 + + } + finally + { + IL_0042: ldloc.3 + IL_0043: isinst [runtime]System.IDisposable + IL_0048: stloc.s V_4 + IL_004a: ldloc.s V_4 + IL_004c: brfalse.s IL_0056 + + IL_004e: ldloc.s V_4 + IL_0050: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0055: endfinally + IL_0056: endfinally + } + IL_0057: ret + } + + .method public static void constStart(valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + valuetype [System.Numerics]System.Numerics.BigInteger V_2, + class [runtime]System.Collections.Generic.IEnumerator`1 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: ldc.i4.s 10 + IL_0002: newobj instance void [netstandard]System.Numerics.BigInteger::.ctor(int32) + IL_0007: stloc.1 + IL_0008: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_000d: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0012: stloc.2 + IL_0013: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_0018: ldsfld class assembly/Down/'constStart@46-1' assembly/Down/'constStart@46-1'::@_instance + IL_001d: ldloc.1 + IL_001e: ldloc.2 + IL_001f: ldarg.0 + IL_0020: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_0025: stloc.0 + IL_0026: ldloc.0 + IL_0027: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_002c: stloc.3 + .try + { + IL_002d: br.s IL_003a + + IL_002f: ldloc.3 + IL_0030: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0035: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_003a: ldloc.3 + IL_003b: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0040: brtrue.s IL_002f + + IL_0042: leave.s IL_0059 + + } + finally + { + IL_0044: ldloc.3 + IL_0045: isinst [runtime]System.IDisposable + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: brfalse.s IL_0058 + + IL_0050: ldloc.s V_4 + IL_0052: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0057: endfinally + IL_0058: endfinally + } + IL_0059: ret + } + + .method public static void annotatedStart(valuetype [System.Numerics]System.Numerics.BigInteger start, + valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + class [runtime]System.Collections.Generic.IEnumerator`1 V_2, + class [runtime]System.IDisposable V_3) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_000a: stloc.1 + IL_000b: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_0010: ldsfld class assembly/Down/'annotatedStart@50-1' assembly/Down/'annotatedStart@50-1'::@_instance + IL_0015: ldarg.0 + IL_0016: ldloc.1 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_001d: stloc.0 + IL_001e: ldloc.0 + IL_001f: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0024: stloc.2 + .try + { + IL_0025: br.s IL_0032 + + IL_0027: ldloc.2 + IL_0028: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_002d: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0032: ldloc.2 + IL_0033: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0038: brtrue.s IL_0027 + + IL_003a: leave.s IL_004e + + } + finally + { + IL_003c: ldloc.2 + IL_003d: isinst [runtime]System.IDisposable + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: brfalse.s IL_004d + + IL_0046: ldloc.3 + IL_0047: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_004c: endfinally + IL_004d: endfinally + } + IL_004e: ret + } + + .method public static void annotatedFinish(valuetype [System.Numerics]System.Numerics.BigInteger start, + valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + class [runtime]System.Collections.Generic.IEnumerator`1 V_2, + class [runtime]System.IDisposable V_3) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_000a: stloc.1 + IL_000b: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_0010: ldsfld class assembly/Down/'annotatedFinish@54-1' assembly/Down/'annotatedFinish@54-1'::@_instance + IL_0015: ldarg.0 + IL_0016: ldloc.1 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_001d: stloc.0 + IL_001e: ldloc.0 + IL_001f: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0024: stloc.2 + .try + { + IL_0025: br.s IL_0032 + + IL_0027: ldloc.2 + IL_0028: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_002d: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0032: ldloc.2 + IL_0033: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0038: brtrue.s IL_0027 + + IL_003a: leave.s IL_004e + + } + finally + { + IL_003c: ldloc.2 + IL_003d: isinst [runtime]System.IDisposable + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: brfalse.s IL_004d + + IL_0046: ldloc.3 + IL_0047: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_004c: endfinally + IL_004d: endfinally + } + IL_004e: ret + } + + .method public static void inferredStartAndFinish(valuetype [System.Numerics]System.Numerics.BigInteger start, + valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 7 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + class [runtime]System.Collections.Generic.IEnumerator`1 V_2, + class [runtime]System.IDisposable V_3) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_UnaryNegation(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_000a: stloc.1 + IL_000b: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_Zero() + IL_0010: ldsfld class assembly/Down/'inferredStartAndFinish@58-1' assembly/Down/'inferredStartAndFinish@58-1'::@_instance + IL_0015: ldarg.0 + IL_0016: ldloc.1 + IL_0017: ldarg.1 + IL_0018: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeStepGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!1, + !!0, + !!1) + IL_001d: stloc.0 + IL_001e: ldloc.0 + IL_001f: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0024: stloc.2 + .try + { + IL_0025: br.s IL_0032 + + IL_0027: ldloc.2 + IL_0028: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_002d: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0032: ldloc.2 + IL_0033: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0038: brtrue.s IL_0027 + + IL_003a: leave.s IL_004e + + } + finally + { + IL_003c: ldloc.2 + IL_003d: isinst [runtime]System.IDisposable + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: brfalse.s IL_004d + + IL_0046: ldloc.3 + IL_0047: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_004c: endfinally + IL_004d: endfinally + } + IL_004e: ret + } + + } + + .class abstract auto ansi sealed nested public Up + 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 ) + .class auto ansi serializable sealed nested assembly beforefieldinit constEmpty@5 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/constEmpty@5 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/constEmpty@5::.ctor() + IL_0005: stsfld class assembly/Up/constEmpty@5 assembly/Up/constEmpty@5::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit constNonEmpty@9 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/constNonEmpty@9 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/constNonEmpty@9::.ctor() + IL_0005: stsfld class assembly/Up/constNonEmpty@9 assembly/Up/constNonEmpty@9::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit constFinish@13 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/constFinish@13 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/constFinish@13::.ctor() + IL_0005: stsfld class assembly/Up/constFinish@13 assembly/Up/constFinish@13::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit constStart@17 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/constStart@17 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/constStart@17::.ctor() + IL_0005: stsfld class assembly/Up/constStart@17 assembly/Up/constStart@17::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit annotatedStart@21 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/annotatedStart@21 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/annotatedStart@21::.ctor() + IL_0005: stsfld class assembly/Up/annotatedStart@21 assembly/Up/annotatedStart@21::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit annotatedFinish@25 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/annotatedFinish@25 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/annotatedFinish@25::.ctor() + IL_0005: stsfld class assembly/Up/annotatedFinish@25 assembly/Up/annotatedFinish@25::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit inferredStartAndFinish@29 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/Up/inferredStartAndFinish@29 @_instance + .method assembly specialname rtspecialname instance void .ctor() cil managed + { + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3::.ctor() + IL_0006: ret + } + + .method public strict virtual instance valuetype [System.Numerics]System.Numerics.BigInteger Invoke(valuetype [System.Numerics]System.Numerics.BigInteger x, valuetype [System.Numerics]System.Numerics.BigInteger y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::op_Addition(valuetype [System.Numerics]System.Numerics.BigInteger, + valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0007: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/Up/inferredStartAndFinish@29::.ctor() + IL_0005: stsfld class assembly/Up/inferredStartAndFinish@29 assembly/Up/inferredStartAndFinish@29::@_instance + IL_000a: ret + } + + } + + .method public static void constEmpty() cil managed + { + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + valuetype [System.Numerics]System.Numerics.BigInteger V_2, + class [runtime]System.Collections.Generic.IEnumerator`1 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: ldc.i4.s 10 + IL_0002: newobj instance void [netstandard]System.Numerics.BigInteger::.ctor(int32) + IL_0007: stloc.1 + IL_0008: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_One() + IL_000d: stloc.2 + IL_000e: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0013: ldsfld class assembly/Up/constEmpty@5 assembly/Up/constEmpty@5::@_instance + IL_0018: ldloc.1 + IL_0019: ldloc.2 + IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_001f: stloc.0 + IL_0020: ldloc.0 + IL_0021: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0026: stloc.3 + .try + { + IL_0027: br.s IL_0034 + + IL_0029: ldloc.3 + IL_002a: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_002f: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0034: ldloc.3 + IL_0035: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003a: brtrue.s IL_0029 + + IL_003c: leave.s IL_0053 + + } + finally + { + IL_003e: ldloc.3 + IL_003f: isinst [runtime]System.IDisposable + IL_0044: stloc.s V_4 + IL_0046: ldloc.s V_4 + IL_0048: brfalse.s IL_0052 + + IL_004a: ldloc.s V_4 + IL_004c: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0051: endfinally + IL_0052: endfinally + } + IL_0053: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + valuetype [System.Numerics]System.Numerics.BigInteger V_2, + class [runtime]System.Collections.Generic.IEnumerator`1 V_3, + class [runtime]System.IDisposable V_4) + IL_0000: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_One() + IL_0005: stloc.1 + IL_0006: ldc.i4.s 10 + IL_0008: newobj instance void [netstandard]System.Numerics.BigInteger::.ctor(int32) + IL_000d: stloc.2 + IL_000e: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0013: ldsfld class assembly/Up/constNonEmpty@9 assembly/Up/constNonEmpty@9::@_instance + IL_0018: ldloc.1 + IL_0019: ldloc.2 + IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_001f: stloc.0 + IL_0020: ldloc.0 + IL_0021: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0026: stloc.3 + .try + { + IL_0027: br.s IL_0034 + + IL_0029: ldloc.3 + IL_002a: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_002f: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0034: ldloc.3 + IL_0035: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_003a: brtrue.s IL_0029 + + IL_003c: leave.s IL_0053 + + } + finally + { + IL_003e: ldloc.3 + IL_003f: isinst [runtime]System.IDisposable + IL_0044: stloc.s V_4 + IL_0046: ldloc.s V_4 + IL_0048: brfalse.s IL_0052 + + IL_004a: ldloc.s V_4 + IL_004c: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0051: endfinally + IL_0052: endfinally + } + IL_0053: ret + } + + .method public static void constFinish(valuetype [System.Numerics]System.Numerics.BigInteger start) cil managed + { + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + class [runtime]System.Collections.Generic.IEnumerator`1 V_2, + class [runtime]System.IDisposable V_3) + IL_0000: ldc.i4.s 10 + IL_0002: newobj instance void [netstandard]System.Numerics.BigInteger::.ctor(int32) + IL_0007: stloc.1 + IL_0008: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_000d: ldsfld class assembly/Up/constFinish@13 assembly/Up/constFinish@13::@_instance + IL_0012: ldarg.0 + IL_0013: ldloc.1 + IL_0014: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_0019: stloc.0 + IL_001a: ldloc.0 + IL_001b: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0020: stloc.2 + .try + { + IL_0021: br.s IL_002e + + IL_0023: ldloc.2 + IL_0024: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0029: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_002e: ldloc.2 + IL_002f: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0034: brtrue.s IL_0023 + + IL_0036: leave.s IL_004a + + } + finally + { + IL_0038: ldloc.2 + IL_0039: isinst [runtime]System.IDisposable + IL_003e: stloc.3 + IL_003f: ldloc.3 + IL_0040: brfalse.s IL_0049 + + IL_0042: ldloc.3 + IL_0043: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0048: endfinally + IL_0049: endfinally + } + IL_004a: ret + } + + .method public static void constStart(valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + valuetype [System.Numerics]System.Numerics.BigInteger V_1, + class [runtime]System.Collections.Generic.IEnumerator`1 V_2, + class [runtime]System.IDisposable V_3) + IL_0000: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_One() + IL_0005: stloc.1 + IL_0006: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_000b: ldsfld class assembly/Up/constStart@17 assembly/Up/constStart@17::@_instance + IL_0010: ldloc.1 + IL_0011: ldarg.0 + IL_0012: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_001e: stloc.2 + .try + { + IL_001f: br.s IL_002c + + IL_0021: ldloc.2 + IL_0022: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0027: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_002c: ldloc.2 + IL_002d: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_0032: brtrue.s IL_0021 + + IL_0034: leave.s IL_0048 + + } + finally + { + IL_0036: ldloc.2 + IL_0037: isinst [runtime]System.IDisposable + IL_003c: stloc.3 + IL_003d: ldloc.3 + IL_003e: brfalse.s IL_0047 + + IL_0040: ldloc.3 + IL_0041: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0046: endfinally + IL_0047: endfinally + } + IL_0048: ret + } + + .method public static void annotatedStart(valuetype [System.Numerics]System.Numerics.BigInteger start, + valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.IDisposable V_2) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: ldsfld class assembly/Up/annotatedStart@21 assembly/Up/annotatedStart@21::@_instance + IL_000a: ldarg.0 + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0018: stloc.1 + .try + { + IL_0019: br.s IL_0026 + + IL_001b: ldloc.1 + IL_001c: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0021: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0026: ldloc.1 + IL_0027: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_002c: brtrue.s IL_001b + + IL_002e: leave.s IL_0042 + + } + finally + { + IL_0030: ldloc.1 + IL_0031: isinst [runtime]System.IDisposable + IL_0036: stloc.2 + IL_0037: ldloc.2 + IL_0038: brfalse.s IL_0041 + + IL_003a: ldloc.2 + IL_003b: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0040: endfinally + IL_0041: endfinally + } + IL_0042: ret + } + + .method public static void annotatedFinish(valuetype [System.Numerics]System.Numerics.BigInteger start, + valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.IDisposable V_2) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: ldsfld class assembly/Up/annotatedFinish@25 assembly/Up/annotatedFinish@25::@_instance + IL_000a: ldarg.0 + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0018: stloc.1 + .try + { + IL_0019: br.s IL_0026 + + IL_001b: ldloc.1 + IL_001c: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0021: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0026: ldloc.1 + IL_0027: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_002c: brtrue.s IL_001b + + IL_002e: leave.s IL_0042 + + } + finally + { + IL_0030: ldloc.1 + IL_0031: isinst [runtime]System.IDisposable + IL_0036: stloc.2 + IL_0037: ldloc.2 + IL_0038: brfalse.s IL_0041 + + IL_003a: ldloc.2 + IL_003b: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0040: endfinally + IL_0041: endfinally + } + IL_0042: ret + } + + .method public static void inferredStartAndFinish(valuetype [System.Numerics]System.Numerics.BigInteger start, + valuetype [System.Numerics]System.Numerics.BigInteger finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 6 + .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, + class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + class [runtime]System.IDisposable V_2) + IL_0000: call valuetype [System.Numerics]System.Numerics.BigInteger [System.Numerics]System.Numerics.BigInteger::get_One() + IL_0005: ldsfld class assembly/Up/inferredStartAndFinish@29 assembly/Up/inferredStartAndFinish@29::@_instance + IL_000a: ldarg.0 + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeGeneric(!!0, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>, + !!0, + !!0) + IL_0011: stloc.0 + IL_0012: ldloc.0 + IL_0013: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() + IL_0018: stloc.1 + .try + { + IL_0019: br.s IL_0026 + + IL_001b: ldloc.1 + IL_001c: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() + IL_0021: call void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + IL_0026: ldloc.1 + IL_0027: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() + IL_002c: brtrue.s IL_001b + + IL_002e: leave.s IL_0042 + + } + finally + { + IL_0030: ldloc.1 + IL_0031: isinst [runtime]System.IDisposable + IL_0036: stloc.2 + IL_0037: ldloc.2 + IL_0038: brfalse.s IL_0041 + + IL_003a: ldloc.2 + IL_003b: callvirt instance void [runtime]System.IDisposable::Dispose() + IL_0040: endfinally + IL_0041: endfinally + } + IL_0042: ret + } + + } + + .field static assembly valuetype [System.Numerics]System.Numerics.BigInteger c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static valuetype [System.Numerics]System.Numerics.BigInteger get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld valuetype [System.Numerics]System.Numerics.BigInteger assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(valuetype [System.Numerics]System.Numerics.BigInteger 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld valuetype [System.Numerics]System.Numerics.BigInteger assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: call valuetype [netstandard]System.Numerics.BigInteger [netstandard]System.Numerics.BigInteger::get_Zero() + IL_0005: stsfld valuetype [System.Numerics]System.Numerics.BigInteger assembly::c@1 + IL_000a: ret + } + + .property valuetype [System.Numerics]System.Numerics.BigInteger + c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(valuetype [System.Numerics]System.Numerics.BigInteger) + .get valuetype [System.Numerics]System.Numerics.BigInteger assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs new file mode 100644 index 00000000000..660c5b40bc0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs @@ -0,0 +1,30 @@ +let mutable c = 0uy + +module Up = + let constEmpty () = + for n = 10uy to 1uy do + c <- n + + let constNonEmpty () = + for n = 1uy to 10uy do + c <- n + + let constFinish start = + for n = start to 10uy do + c <- n + + let constStart finish = + for n = 1uy to finish do + c <- n + + let annotatedStart (start: byte) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: byte) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..81fe8dea479 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,405 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (uint8 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void constFinish(uint8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.u2 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint8) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret + } + + .method public static void constStart(uint8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.u2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedStart(uint8 start, + uint8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(uint8 start, + uint8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(uint8 start, + uint8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .field static assembly uint8 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static uint8 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint8 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint8 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint8 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld uint8 assembly::c@1 + IL_0006: ret + } + + .property uint8 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint8) + .get uint8 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs new file mode 100644 index 00000000000..1ce1b74b188 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs @@ -0,0 +1,30 @@ +let mutable c = '\000' + +module Up = + let constEmpty () = + for n = 'z' to 'a' do + c <- n + + let constNonEmpty () = + for n = 'a' to 'z' do + c <- n + + let constFinish start = + for n = start to 'z' do + c <- n + + let constStart finish = + for n = 'a' to finish do + c <- n + + let annotatedStart (start: char) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: char) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..a75d300e93c --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopChar.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,405 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (char V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 122 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + char V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 97 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(char) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 26 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void constFinish(char start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldc.i4.s 122 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 122 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(char) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret + } + + .method public static void constStart(char finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.s 97 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.s 97 + IL_000c: sub + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.s 97 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(char) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void annotatedStart(char start, + char finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(char) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(char start, + char finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(char) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(char start, + char finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(char) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .field static assembly char c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static char get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld char assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(char 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld char assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld char assembly::c@1 + IL_0006: ret + } + + .property char c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(char) + .get char assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs new file mode 100644 index 00000000000..5940af4c247 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs @@ -0,0 +1,59 @@ +let mutable c = 0s + +module Up = + let constEmpty () = + for n = 10s to 1s do + c <- n + + let constNonEmpty () = + for n = 1s to 10s do + c <- n + + let constFinish start = + for n = start to 10s do + c <- n + + let constStart finish = + for n = 1s to finish do + c <- n + + let annotatedStart (start: int16) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: int16) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n + +module Down = + let constEmpty () = + for n = 1s downto 10s do + c <- n + + let constNonEmpty () = + for n = 10s downto 1s do + c <- n + + let constFinish start = + for n = start downto 1s do + c <- n + + let constStart finish = + for n = 10s downto finish do + c <- n + + let annotatedStart (start: int16) finish = + for n = start downto finish do + c <- n + + let annotatedFinish start (finish: int16) = + for n = start downto finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start downto finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..c5e917f009d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,705 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Down + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int16 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.m1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.m1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 10 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void constFinish(int16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void constStart(int16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.s 10 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(int16) + IL_001f: ldloc.2 + IL_0020: ldc.i4.m1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void annotatedStart(int16 start, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(int16 start, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(int16 start, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int16 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + int16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void constFinish(int16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int16) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret + } + + .method public static void constStart(int16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedStart(int16 start, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(int16 start, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(int16 start, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.i4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .field static assembly int16 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static int16 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int16 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int16 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int16 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int16 assembly::c@1 + IL_0006: ret + } + + .property int16 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int16) + .get int16 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs new file mode 100644 index 00000000000..ab8d5f165df --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs @@ -0,0 +1,83 @@ +open System.Runtime.CompilerServices + +let mutable c = 0 + +[] +let f<'a> (x: 'a) = ignore x + +[] +let forceBoxing (x: obj) = ignore x + +module Up = + let constEmpty () = + for n = 10 to 1 do + c <- n + + let constNonEmpty () = + for n = 1 to 10 do + c <- n + + let constFinish start = + for n = start to 10 do + c <- n + + let constStart finish = + for n = 1 to finish do + c <- n + + let annotatedStart (start: int) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: int) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n + + let unconstrainedStartAndFinish start finish = + for n = start to finish do + f n + + let boxedLoopVar start finish = + for n = start to finish do + forceBoxing n + +module Down = + let constEmpty () = + for n = 1 downto 10 do + c <- n + + let constNonEmpty () = + for n = 10 downto 1 do + c <- n + + let constFinish start = + for n = start downto 1 do + c <- n + + let constStart finish = + for n = 10 downto finish do + c <- n + + let annotatedStart (start: int) finish = + for n = start downto finish do + c <- n + + let annotatedFinish start (finish: int) = + for n = start downto finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start downto finish do + c <- n + + let unconstrainedStartAndFinish start finish = + for n = start downto finish do + f n + + let boxedLoopVar start finish = + for n = start downto finish do + forceBoxing n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..024d0880b58 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,658 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Down + 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 constEmpty() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.1 + IL_0001: stloc.1 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.0 + IL_0005: ldloc.0 + IL_0006: ldloc.1 + IL_0007: bgt.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int32) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: sub + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: sub + IL_0017: bne.un.s IL_0009 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.s 10 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.0 + IL_0005: ldloc.0 + IL_0006: ldloc.1 + IL_0007: bgt.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int32) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: sub + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: sub + IL_0017: bne.un.s IL_0009 + + IL_0019: ret + } + + .method public static void constFinish(int32 start) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldc.i4.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: bgt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void constStart(int32 finish) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.s 10 + IL_0002: stloc.1 + IL_0003: ldarg.0 + IL_0004: stloc.0 + IL_0005: ldloc.0 + IL_0006: ldloc.1 + IL_0007: bgt.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int32) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: sub + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: sub + IL_0017: bne.un.s IL_0009 + + IL_0019: ret + } + + .method public static void annotatedStart(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: bgt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void annotatedFinish(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: bgt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void inferredStartAndFinish(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: bgt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: sub + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: sub + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void unconstrainedStartAndFinish(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: bgt.s IL_0019 + + IL_0008: ldloc.1 + IL_0009: call void assembly::f(!!0) + IL_000e: nop + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: sub + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: sub + IL_0017: bne.un.s IL_0008 + + IL_0019: ret + } + + .method public static void boxedLoopVar(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: bgt.s IL_001e + + IL_0008: ldloc.1 + IL_0009: box [runtime]System.Int32 + IL_000e: call void assembly::forceBoxing(object) + IL_0013: nop + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: sub + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldloc.0 + IL_001a: ldc.i4.1 + IL_001b: sub + IL_001c: bne.un.s IL_0008 + + IL_001e: ret + } + + } + + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldc.i4.s 10 + IL_0002: stloc.0 + IL_0003: br.s IL_000f + + IL_0005: ldloc.0 + IL_0006: call void assembly::set_c(int32) + IL_000b: ldloc.0 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.2 + IL_0011: blt.s IL_0005 + + IL_0013: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldc.i4.1 + IL_0001: stloc.0 + IL_0002: br.s IL_000e + + IL_0004: ldloc.0 + IL_0005: call void assembly::set_c(int32) + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.s 11 + IL_0011: blt.s IL_0004 + + IL_0013: ret + } + + .method public static void constFinish(int32 start) cil managed + { + + .maxstack 4 + .locals init (int32 V_0) + IL_0000: ldarg.0 + IL_0001: stloc.0 + IL_0002: br.s IL_000e + + IL_0004: ldloc.0 + IL_0005: call void assembly::set_c(int32) + IL_000a: ldloc.0 + IL_000b: ldc.i4.1 + IL_000c: add + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.s 11 + IL_0011: blt.s IL_0004 + + IL_0013: ret + } + + .method public static void constStart(int32 finish) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldc.i4.1 + IL_0001: stloc.1 + IL_0002: ldarg.0 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void annotatedStart(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void annotatedFinish(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void inferredStartAndFinish(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: bne.un.s IL_0008 + + IL_0018: ret + } + + .method public static void unconstrainedStartAndFinish(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_0019 + + IL_0008: ldloc.1 + IL_0009: call void assembly::f(!!0) + IL_000e: nop + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: bne.un.s IL_0008 + + IL_0019: ret + } + + .method public static void boxedLoopVar(int32 start, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1) + IL_0000: ldarg.0 + IL_0001: stloc.1 + IL_0002: ldarg.1 + IL_0003: stloc.0 + IL_0004: ldloc.0 + IL_0005: ldloc.1 + IL_0006: blt.s IL_001e + + IL_0008: ldloc.1 + IL_0009: box [runtime]System.Int32 + IL_000e: call void assembly::forceBoxing(object) + IL_0013: nop + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: add + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldloc.0 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: bne.un.s IL_0008 + + IL_001e: ret + } + + } + + .field static assembly int32 c@3 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static int32 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int32 assembly::c@3 + IL_0005: ret + } + + .method public specialname static void set_c(int32 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int32 assembly::c@3 + IL_0006: ret + } + + .method public static void f(!!a x) cil managed noinlining + { + + .maxstack 8 + IL_0000: ret + } + + .method public static void forceBoxing(object x) cil managed noinlining + { + + .maxstack 8 + IL_0000: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 assembly::c@3 + IL_0006: ret + } + + .property int32 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int32) + .get int32 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs new file mode 100644 index 00000000000..2a906b4e3af --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs @@ -0,0 +1,59 @@ +let mutable c = 0L + +module Up = + let constEmpty () = + for n = 10L to 1L do + c <- n + + let constNonEmpty () = + for n = 1L to 10L do + c <- n + + let constFinish start = + for n = start to 10L do + c <- n + + let constStart finish = + for n = 1L to finish do + c <- n + + let annotatedStart (start: int64) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: int64) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n + +module Down = + let constEmpty () = + for n = 1L downto 10L do + c <- n + + let constNonEmpty () = + for n = 10L downto 1L do + c <- n + + let constFinish start = + for n = start downto 1L do + c <- n + + let constStart finish = + for n = 10L downto finish do + c <- n + + let annotatedStart (start: int64) finish = + for n = start downto finish do + c <- n + + let annotatedFinish start (finish: int64) = + for n = start downto finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start downto finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..f134b547366 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,1088 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Down + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0009 + + IL_001f: ret + } + + .method public static void constFinish(int64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_002a + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int64) + IL_0020: ldloc.2 + IL_0021: ldc.i4.m1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldloc.0 + IL_002c: blt.un.s IL_001a + + IL_002e: ret + } + + .method public static void constStart(int64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: ldarg.0 + IL_0004: bge.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldc.i4.s 10 + IL_001a: conv.i8 + IL_001b: stloc.2 + IL_001c: br.s IL_002e + + IL_001e: ldloc.2 + IL_001f: call void assembly::set_c(int64) + IL_0024: ldloc.2 + IL_0025: ldc.i4.m1 + IL_0026: conv.i8 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.1 + IL_002e: ldloc.1 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001e + + IL_0032: ret + } + + .method public static void annotatedStart(int64 start, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.m1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldarg.1 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.0 + IL_0040: ldarg.1 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.m1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + .method public static void annotatedFinish(int64 start, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.m1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldarg.1 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.0 + IL_0040: ldarg.1 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.m1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + .method public static void inferredStartAndFinish(int64 start, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.m1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.0 + IL_0037: ldarg.1 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.0 + IL_0040: ldarg.1 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.m1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + } + + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0009 + + IL_001e: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.s 10 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0008 + + IL_001e: ret + } + + .method public static void constFinish(int64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: ldarg.0 + IL_0004: bge.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldarg.0 + IL_0019: stloc.2 + IL_001a: br.s IL_002c + + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001c + + IL_0030: ret + } + + .method public static void constStart(int64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: br.s IL_002b + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int64) + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldloc.0 + IL_002d: blt.un.s IL_001b + + IL_002f: ret + } + + .method public static void annotatedStart(int64 start, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + .method public static void annotatedFinish(int64 start, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + .method public static void inferredStartAndFinish(int64 start, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(int64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.s V_4 + IL_004b: ldarg.0 + IL_004c: stloc.3 + IL_004d: br.s IL_0061 + + IL_004f: ldloc.3 + IL_0050: call void assembly::set_c(int64) + IL_0055: ldloc.3 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.s V_4 + IL_005c: ldc.i4.1 + IL_005d: conv.i8 + IL_005e: add + IL_005f: stloc.s V_4 + IL_0061: ldloc.s V_4 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + } + + .field static assembly int64 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static int64 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int64 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int64 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int64 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stsfld int64 assembly::c@1 + IL_0007: ret + } + + .property int64 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int64) + .get int64 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs new file mode 100644 index 00000000000..13979ebab9f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs @@ -0,0 +1,59 @@ +let mutable c = 0n + +module Up = + let constEmpty () = + for n = 10n to 1n do + c <- n + + let constNonEmpty () = + for n = 1n to 10n do + c <- n + + let constFinish start = + for n = start to 10n do + c <- n + + let constStart finish = + for n = 1n to finish do + c <- n + + let annotatedStart (start: nativeint) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: nativeint) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n + +module Down = + let constEmpty () = + for n = 1n downto 10n do + c <- n + + let constNonEmpty () = + for n = 10n downto 1n do + c <- n + + let constFinish start = + for n = start downto 1n do + c <- n + + let constStart finish = + for n = 10n downto finish do + c <- n + + let annotatedStart (start: nativeint) finish = + for n = start downto finish do + c <- n + + let annotatedFinish start (finish: nativeint) = + for n = start downto finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start downto finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..f08694df683 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,1618 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Down + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldc.i8 0x1 + IL_0009: conv.i + IL_000a: ldc.i8 0xa + IL_0013: conv.i + IL_0014: bge.s IL_0023 + + IL_0016: ldc.i8 0x0 + IL_001f: conv.i + IL_0020: nop + IL_0021: br.s IL_0039 + + IL_0023: ldc.i8 0x1 + IL_002c: conv.i + IL_002d: ldc.i8 0xa + IL_0036: conv.i + IL_0037: sub + IL_0038: nop + IL_0039: stloc.0 + IL_003a: sizeof [runtime]System.IntPtr + IL_0040: ldc.i4.4 + IL_0041: bne.un.s IL_0053 + + IL_0043: ldloc.0 + IL_0044: ldc.i8 0xffffffff + IL_004d: conv.u + IL_004e: ceq + IL_0050: nop + IL_0051: br.s IL_0061 + + IL_0053: ldloc.0 + IL_0054: ldc.i8 0xffffffffffffffff + IL_005d: conv.u + IL_005e: ceq + IL_0060: nop + IL_0061: brfalse.s IL_00af + + IL_0063: ldc.i4.1 + IL_0064: stloc.1 + IL_0065: ldc.i8 0x0 + IL_006e: conv.i + IL_006f: stloc.2 + IL_0070: ldc.i8 0x1 + IL_0079: conv.i + IL_007a: stloc.3 + IL_007b: br.s IL_00ab + + IL_007d: ldloc.3 + IL_007e: call void assembly::set_c(native int) + IL_0083: ldloc.3 + IL_0084: ldc.i8 0xffffffffffffffff + IL_008d: conv.i + IL_008e: add + IL_008f: stloc.3 + IL_0090: ldloc.2 + IL_0091: ldc.i8 0x1 + IL_009a: conv.i + IL_009b: add + IL_009c: stloc.2 + IL_009d: ldloc.2 + IL_009e: ldc.i8 0x0 + IL_00a7: conv.i + IL_00a8: cgt.un + IL_00aa: stloc.1 + IL_00ab: ldloc.1 + IL_00ac: brtrue.s IL_007d + + IL_00ae: ret + + IL_00af: ldc.i8 0x1 + IL_00b8: conv.i + IL_00b9: ldc.i8 0xa + IL_00c2: conv.i + IL_00c3: bge.s IL_00d2 + + IL_00c5: ldc.i8 0x0 + IL_00ce: conv.i + IL_00cf: nop + IL_00d0: br.s IL_00f3 + + IL_00d2: ldc.i8 0x1 + IL_00db: conv.i + IL_00dc: ldc.i8 0xa + IL_00e5: conv.i + IL_00e6: sub + IL_00e7: ldc.i8 0x1 + IL_00f0: conv.i + IL_00f1: add.ovf.un + IL_00f2: nop + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x0 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: ldc.i8 0x1 + IL_0108: conv.i + IL_0109: stloc.s V_4 + IL_010b: br.s IL_0130 + + IL_010d: ldloc.s V_4 + IL_010f: call void assembly::set_c(native int) + IL_0114: ldloc.s V_4 + IL_0116: ldc.i8 0xffffffffffffffff + IL_011f: conv.i + IL_0120: add + IL_0121: stloc.s V_4 + IL_0123: ldloc.3 + IL_0124: ldc.i8 0x1 + IL_012d: conv.i + IL_012e: add + IL_012f: stloc.3 + IL_0130: ldloc.3 + IL_0131: ldloc.2 + IL_0132: blt.un.s IL_010d + + IL_0134: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldc.i8 0xa + IL_0009: conv.i + IL_000a: ldc.i8 0x1 + IL_0013: conv.i + IL_0014: bge.s IL_0023 + + IL_0016: ldc.i8 0x0 + IL_001f: conv.i + IL_0020: nop + IL_0021: br.s IL_0039 + + IL_0023: ldc.i8 0xa + IL_002c: conv.i + IL_002d: ldc.i8 0x1 + IL_0036: conv.i + IL_0037: sub + IL_0038: nop + IL_0039: stloc.0 + IL_003a: sizeof [runtime]System.IntPtr + IL_0040: ldc.i4.4 + IL_0041: bne.un.s IL_0053 + + IL_0043: ldloc.0 + IL_0044: ldc.i8 0xffffffff + IL_004d: conv.u + IL_004e: ceq + IL_0050: nop + IL_0051: br.s IL_0061 + + IL_0053: ldloc.0 + IL_0054: ldc.i8 0xffffffffffffffff + IL_005d: conv.u + IL_005e: ceq + IL_0060: nop + IL_0061: brfalse.s IL_00af + + IL_0063: ldc.i4.1 + IL_0064: stloc.1 + IL_0065: ldc.i8 0x0 + IL_006e: conv.i + IL_006f: stloc.2 + IL_0070: ldc.i8 0xa + IL_0079: conv.i + IL_007a: stloc.3 + IL_007b: br.s IL_00ab + + IL_007d: ldloc.3 + IL_007e: call void assembly::set_c(native int) + IL_0083: ldloc.3 + IL_0084: ldc.i8 0xffffffffffffffff + IL_008d: conv.i + IL_008e: add + IL_008f: stloc.3 + IL_0090: ldloc.2 + IL_0091: ldc.i8 0x1 + IL_009a: conv.i + IL_009b: add + IL_009c: stloc.2 + IL_009d: ldloc.2 + IL_009e: ldc.i8 0x0 + IL_00a7: conv.i + IL_00a8: cgt.un + IL_00aa: stloc.1 + IL_00ab: ldloc.1 + IL_00ac: brtrue.s IL_007d + + IL_00ae: ret + + IL_00af: ldc.i8 0xa + IL_00b8: conv.i + IL_00b9: ldc.i8 0x1 + IL_00c2: conv.i + IL_00c3: bge.s IL_00d2 + + IL_00c5: ldc.i8 0x0 + IL_00ce: conv.i + IL_00cf: nop + IL_00d0: br.s IL_00f3 + + IL_00d2: ldc.i8 0xa + IL_00db: conv.i + IL_00dc: ldc.i8 0x1 + IL_00e5: conv.i + IL_00e6: sub + IL_00e7: ldc.i8 0x1 + IL_00f0: conv.i + IL_00f1: add.ovf.un + IL_00f2: nop + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x0 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: ldc.i8 0xa + IL_0108: conv.i + IL_0109: stloc.s V_4 + IL_010b: br.s IL_0130 + + IL_010d: ldloc.s V_4 + IL_010f: call void assembly::set_c(native int) + IL_0114: ldloc.s V_4 + IL_0116: ldc.i8 0xffffffffffffffff + IL_011f: conv.i + IL_0120: add + IL_0121: stloc.s V_4 + IL_0123: ldloc.3 + IL_0124: ldc.i8 0x1 + IL_012d: conv.i + IL_012e: add + IL_012f: stloc.3 + IL_0130: ldloc.3 + IL_0131: ldloc.2 + IL_0132: blt.un.s IL_010d + + IL_0134: ret + } + + .method public static void constFinish(native int start) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.i + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.i + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_0094 + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i + IL_005d: stloc.2 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native int) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0xffffffffffffffff + IL_0072: conv.i + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.i + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldarg.0 + IL_0095: ldc.i8 0x1 + IL_009e: conv.i + IL_009f: bge.s IL_00ae + + IL_00a1: ldc.i8 0x0 + IL_00aa: conv.i + IL_00ab: nop + IL_00ac: br.s IL_00c6 + + IL_00ae: ldarg.0 + IL_00af: ldc.i8 0x1 + IL_00b8: conv.i + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.i + IL_00c4: add.ovf.un + IL_00c5: nop + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: stloc.3 + IL_00d2: ldarg.0 + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native int) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0xffffffffffffffff + IL_00e9: conv.i + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.i + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret + } + + .method public static void constStart(native int finish) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldc.i8 0xa + IL_0009: conv.i + IL_000a: ldarg.0 + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldc.i8 0xa + IL_0023: conv.i + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i + IL_005d: stloc.2 + IL_005e: ldc.i8 0xa + IL_0067: conv.i + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native int) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0xffffffffffffffff + IL_007b: conv.i + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.i + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldc.i8 0xa + IL_00a6: conv.i + IL_00a7: ldarg.0 + IL_00a8: bge.s IL_00b7 + + IL_00aa: ldc.i8 0x0 + IL_00b3: conv.i + IL_00b4: nop + IL_00b5: br.s IL_00cf + + IL_00b7: ldc.i8 0xa + IL_00c0: conv.i + IL_00c1: ldarg.0 + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.i + IL_00cd: add.ovf.un + IL_00ce: nop + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.i + IL_00da: stloc.3 + IL_00db: ldc.i8 0xa + IL_00e4: conv.i + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native int) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0xffffffffffffffff + IL_00fb: conv.i + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.i + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret + } + + .method public static void annotatedStart(native int start, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.0 + IL_0012: ldarg.1 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0xffffffffffffffff + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.0 + IL_0083: ldarg.1 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.0 + IL_0094: ldarg.1 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0xffffffffffffffff + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + .method public static void annotatedFinish(native int start, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.0 + IL_0012: ldarg.1 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0xffffffffffffffff + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.0 + IL_0083: ldarg.1 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.0 + IL_0094: ldarg.1 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0xffffffffffffffff + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + .method public static void inferredStartAndFinish(native int start, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.0 + IL_0012: ldarg.1 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0xffffffffffffffff + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.0 + IL_0083: ldarg.1 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.0 + IL_0094: ldarg.1 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0xffffffffffffffff + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + } + + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0xa + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x0 + IL_0042: conv.i + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.i + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native int) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.i + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.i + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0xa + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void constFinish(native int start) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldc.i8 0xa + IL_0009: conv.i + IL_000a: ldarg.0 + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldc.i8 0xa + IL_0023: conv.i + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_0094 + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i + IL_005d: stloc.2 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native int) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0x1 + IL_0072: conv.i + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.i + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldc.i8 0xa + IL_009d: conv.i + IL_009e: ldarg.0 + IL_009f: bge.s IL_00ae + + IL_00a1: ldc.i8 0x0 + IL_00aa: conv.i + IL_00ab: nop + IL_00ac: br.s IL_00c6 + + IL_00ae: ldc.i8 0xa + IL_00b7: conv.i + IL_00b8: ldarg.0 + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.i + IL_00c4: add.ovf.un + IL_00c5: nop + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: stloc.3 + IL_00d2: ldarg.0 + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native int) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.i + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.i + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret + } + + .method public static void constStart(native int finish) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.i + IL_000b: bge.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.i + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.i + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.i + IL_005d: stloc.2 + IL_005e: ldc.i8 0x1 + IL_0067: conv.i + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native int) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0x1 + IL_007b: conv.i + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.i + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldarg.0 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.i + IL_00a8: bge.s IL_00b7 + + IL_00aa: ldc.i8 0x0 + IL_00b3: conv.i + IL_00b4: nop + IL_00b5: br.s IL_00cf + + IL_00b7: ldarg.0 + IL_00b8: ldc.i8 0x1 + IL_00c1: conv.i + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.i + IL_00cd: add.ovf.un + IL_00ce: nop + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.i + IL_00da: stloc.3 + IL_00db: ldc.i8 0x1 + IL_00e4: conv.i + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native int) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.i + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.i + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret + } + + .method public static void annotatedStart(native int start, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + .method public static void annotatedFinish(native int start, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + .method public static void inferredStartAndFinish(native int start, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native int V_0, + bool V_1, + native int V_2, + native int V_3, + native int V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.i + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.i + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native int) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.i + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.i + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.i + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.i + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.i + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.i + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native int) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.i + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.i + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + } + + .field static assembly native int c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static native int get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld native int assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(native int 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld native int assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stsfld native int assembly::c@1 + IL_000f: ret + } + + .property native int c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(native int) + .get native int assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs new file mode 100644 index 00000000000..f107962c5f8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs @@ -0,0 +1,59 @@ +let mutable c = 0y + +module Up = + let constEmpty () = + for n = 10y to 1y do + c <- n + + let constNonEmpty () = + for n = 1y to 10y do + c <- n + + let constFinish start = + for n = start to 10y do + c <- n + + let constStart finish = + for n = 1y to finish do + c <- n + + let annotatedStart (start: sbyte) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: sbyte) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n + +module Down = + let constEmpty () = + for n = 1y downto 10y do + c <- n + + let constNonEmpty () = + for n = 10y downto 1y do + c <- n + + let constFinish start = + for n = start downto 1y do + c <- n + + let constStart finish = + for n = 10y downto finish do + c <- n + + let annotatedStart (start: sbyte) finish = + for n = start downto finish do + c <- n + + let annotatedFinish start (finish: sbyte) = + for n = start downto finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start downto finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..fa00532415a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopSByte.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,705 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Down + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int8 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.m1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.0 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.m1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.s 10 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void constFinish(int8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void constStart(int8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i2 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldc.i4.s 10 + IL_0016: stloc.2 + IL_0017: br.s IL_0027 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(int8) + IL_001f: ldloc.2 + IL_0020: ldc.i4.m1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: add + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: ldloc.0 + IL_0029: blt.un.s IL_0019 + + IL_002b: ret + } + + .method public static void annotatedStart(int8 start, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(int8 start, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(int8 start, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldarg.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldarg.1 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.m1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (int8 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + int8 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(int8) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void constFinish(int8 start) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i2 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int8) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret + } + + .method public static void constStart(int8 finish) cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedStart(int8 start, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(int8 start, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(int8 start, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.i2 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(int8) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .field static assembly int8 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static int8 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int8 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(int8 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld int8 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int8 assembly::c@1 + IL_0006: ret + } + + .property int8 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(int8) + .get int8 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs new file mode 100644 index 00000000000..53b4ab8b8e1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs @@ -0,0 +1,30 @@ +let mutable c = 0us + +module Up = + let constEmpty () = + for n = 10us to 1us do + c <- n + + let constNonEmpty () = + for n = 1us to 10us do + c <- n + + let constFinish start = + for n = start to 10us do + c <- n + + let constStart finish = + for n = 1us to finish do + c <- n + + let annotatedStart (start: uint16) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: uint16) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..bffa74cbf43 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt16.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,405 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (uint16 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint16 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.1 + IL_0003: stloc.1 + IL_0004: br.s IL_0014 + + IL_0006: ldloc.1 + IL_0007: call void assembly::set_c(uint16) + IL_000c: ldloc.1 + IL_000d: ldc.i4.1 + IL_000e: add + IL_000f: stloc.1 + IL_0010: ldloc.0 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: ldc.i4.s 10 + IL_0017: blt.un.s IL_0006 + + IL_0019: ret + } + + .method public static void constFinish(uint16 start) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_0009 + + IL_0005: ldc.i4.0 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.u4 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: stloc.1 + IL_0014: ldarg.0 + IL_0015: stloc.2 + IL_0016: br.s IL_0026 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint16) + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: add + IL_0021: stloc.2 + IL_0022: ldloc.1 + IL_0023: ldc.i4.1 + IL_0024: add + IL_0025: stloc.1 + IL_0026: ldloc.1 + IL_0027: ldloc.0 + IL_0028: blt.un.s IL_0018 + + IL_002a: ret + } + + .method public static void constStart(uint16 finish) cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldc.i4.1 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedStart(uint16 start, + uint16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void annotatedFinish(uint16 start, + uint16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + .method public static void inferredStartAndFinish(uint16 start, + uint16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0008 + + IL_0004: ldc.i4.0 + IL_0005: nop + IL_0006: br.s IL_000f + + IL_0008: ldarg.1 + IL_0009: ldarg.0 + IL_000a: sub + IL_000b: conv.u4 + IL_000c: ldc.i4.1 + IL_000d: add + IL_000e: nop + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: stloc.1 + IL_0012: ldarg.0 + IL_0013: stloc.2 + IL_0014: br.s IL_0024 + + IL_0016: ldloc.2 + IL_0017: call void assembly::set_c(uint16) + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.2 + IL_0020: ldloc.1 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0016 + + IL_0028: ret + } + + } + + .field static assembly uint16 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static uint16 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint16 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint16 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint16 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld uint16 assembly::c@1 + IL_0006: ret + } + + .property uint16 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint16) + .get uint16 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs new file mode 100644 index 00000000000..4c203441267 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs @@ -0,0 +1,30 @@ +let mutable c = 0u + +module Up = + let constEmpty () = + for n = 10u to 1u do + c <- n + + let constNonEmpty () = + for n = 1u to 10u do + c <- n + + let constFinish start = + for n = start to 10u do + c <- n + + let constStart finish = + for n = 1u to finish do + c <- n + + let annotatedStart (start: uint) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: uint) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..63af17baec6 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt32.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,428 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (uint32 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: stloc.0 + IL_0002: ldc.i4.s 10 + IL_0004: stloc.1 + IL_0005: br.s IL_0015 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: add + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: ldc.i4.0 + IL_0017: blt.un.s IL_0007 + + IL_0019: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: stloc.1 + IL_0005: br.s IL_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(uint32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.1 + IL_000f: add + IL_0010: stloc.1 + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.s 10 + IL_0019: conv.i8 + IL_001a: blt.un.s IL_0007 + + IL_001c: ret + } + + .method public static void constFinish(uint32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0013 + + IL_000a: ldc.i4.s 10 + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: conv.u8 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.1 + IL_0017: ldarg.0 + IL_0018: stloc.2 + IL_0019: br.s IL_002a + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint32) + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.1 + IL_002a: ldloc.1 + IL_002b: ldloc.0 + IL_002c: blt.un.s IL_001b + + IL_002e: ret + } + + .method public static void constStart(uint32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: conv.u8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldc.i4.1 + IL_0016: stloc.2 + IL_0017: br.s IL_0028 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint32) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0019 + + IL_002c: ret + } + + .method public static void annotatedStart(uint32 start, + uint32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: conv.u8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0028 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint32) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0019 + + IL_002c: ret + } + + .method public static void annotatedFinish(uint32 start, + uint32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: conv.u8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0028 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint32) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0019 + + IL_002c: ret + } + + .method public static void inferredStartAndFinish(uint32 start, + uint32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0011 + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: conv.u8 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: add + IL_0010: nop + IL_0011: stloc.0 + IL_0012: ldc.i4.0 + IL_0013: conv.i8 + IL_0014: stloc.1 + IL_0015: ldarg.0 + IL_0016: stloc.2 + IL_0017: br.s IL_0028 + + IL_0019: ldloc.2 + IL_001a: call void assembly::set_c(uint32) + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: add + IL_0022: stloc.2 + IL_0023: ldloc.1 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_0019 + + IL_002c: ret + } + + } + + .field static assembly uint32 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static uint32 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint32 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint32 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint32 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld uint32 assembly::c@1 + IL_0006: ret + } + + .property uint32 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint32) + .get uint32 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs new file mode 100644 index 00000000000..3e4ae342eda --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs @@ -0,0 +1,30 @@ +let mutable c = 0UL + +module Up = + let constEmpty () = + for n = 10UL to 1UL do + c <- n + + let constNonEmpty () = + for n = 1UL to 10UL do + c <- n + + let constFinish start = + for n = start to 10UL do + c <- n + + let constStart finish = + for n = 1UL to finish do + c <- n + + let annotatedStart (start: uint64) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: uint64) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..6e49eca3e80 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUInt64.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,597 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: conv.i8 + IL_0006: stloc.1 + IL_0007: br.s IL_0019 + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(uint64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: stloc.1 + IL_0014: ldloc.0 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0009 + + IL_001e: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(uint64) + IL_000e: ldloc.1 + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add + IL_0012: stloc.1 + IL_0013: ldloc.0 + IL_0014: ldc.i4.1 + IL_0015: conv.i8 + IL_0016: add + IL_0017: stloc.0 + IL_0018: ldloc.0 + IL_0019: ldc.i4.s 10 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0008 + + IL_001e: ret + } + + .method public static void constFinish(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: ldarg.0 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0014 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add.ovf.un + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.1 + IL_0018: ldarg.0 + IL_0019: stloc.2 + IL_001a: br.s IL_002c + + IL_001c: ldloc.2 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.2 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.2 + IL_0027: ldloc.1 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldloc.0 + IL_002e: blt.un.s IL_001c + + IL_0030: ret + } + + .method public static void constStart(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: conv.i8 + IL_0003: bge.un.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0012 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add.ovf.un + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: br.s IL_002b + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(uint64) + IL_0021: ldloc.2 + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add + IL_0025: stloc.2 + IL_0026: ldloc.1 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.1 + IL_002c: ldloc.0 + IL_002d: blt.un.s IL_001b + + IL_002f: ret + } + + .method public static void annotatedStart(uint64 start, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.un.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 + IL_004a: ldarg.0 + IL_004b: stloc.s V_4 + IL_004d: br.s IL_0062 + + IL_004f: ldloc.s V_4 + IL_0051: call void assembly::set_c(uint64) + IL_0056: ldloc.s V_4 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_4 + IL_005d: ldloc.3 + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add + IL_0061: stloc.3 + IL_0062: ldloc.3 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + .method public static void annotatedFinish(uint64 start, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.un.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 + IL_004a: ldarg.0 + IL_004b: stloc.s V_4 + IL_004d: br.s IL_0062 + + IL_004f: ldloc.s V_4 + IL_0051: call void assembly::set_c(uint64) + IL_0056: ldloc.s V_4 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_4 + IL_005d: ldloc.3 + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add + IL_0061: stloc.3 + IL_0062: ldloc.3 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + .method public static void inferredStartAndFinish(uint64 start, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_000d + + IL_0009: ldarg.1 + IL_000a: ldarg.0 + IL_000b: sub + IL_000c: nop + IL_000d: stloc.0 + IL_000e: ldloc.0 + IL_000f: ldc.i4.m1 + IL_0010: conv.i8 + IL_0011: bne.un.s IL_0036 + + IL_0013: ldc.i4.1 + IL_0014: stloc.1 + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: stloc.2 + IL_0018: ldarg.0 + IL_0019: stloc.3 + IL_001a: br.s IL_0032 + + IL_001c: ldloc.3 + IL_001d: call void assembly::set_c(uint64) + IL_0022: ldloc.3 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: stloc.3 + IL_0027: ldloc.2 + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add + IL_002b: stloc.2 + IL_002c: ldloc.2 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: cgt.un + IL_0031: stloc.1 + IL_0032: ldloc.1 + IL_0033: brtrue.s IL_001c + + IL_0035: ret + + IL_0036: ldarg.1 + IL_0037: ldarg.0 + IL_0038: bge.un.s IL_003f + + IL_003a: ldc.i4.0 + IL_003b: conv.i8 + IL_003c: nop + IL_003d: br.s IL_0046 + + IL_003f: ldarg.1 + IL_0040: ldarg.0 + IL_0041: sub + IL_0042: ldc.i4.1 + IL_0043: conv.i8 + IL_0044: add.ovf.un + IL_0045: nop + IL_0046: stloc.2 + IL_0047: ldc.i4.0 + IL_0048: conv.i8 + IL_0049: stloc.3 + IL_004a: ldarg.0 + IL_004b: stloc.s V_4 + IL_004d: br.s IL_0062 + + IL_004f: ldloc.s V_4 + IL_0051: call void assembly::set_c(uint64) + IL_0056: ldloc.s V_4 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_4 + IL_005d: ldloc.3 + IL_005e: ldc.i4.1 + IL_005f: conv.i8 + IL_0060: add + IL_0061: stloc.3 + IL_0062: ldloc.3 + IL_0063: ldloc.2 + IL_0064: blt.un.s IL_004f + + IL_0066: ret + } + + } + + .field static assembly uint64 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static uint64 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld uint64 assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(uint64 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld uint64 assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stsfld uint64 assembly::c@1 + IL_0007: ret + } + + .property uint64 c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(uint64) + .get uint64 assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs new file mode 100644 index 00000000000..9762fbbe2a7 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs @@ -0,0 +1,30 @@ +let mutable c = 0un + +module Up = + let constEmpty () = + for n = 10un to 1un do + c <- n + + let constNonEmpty () = + for n = 1un to 10un do + c <- n + + let constFinish start = + for n = start to 10un do + c <- n + + let constStart finish = + for n = 1un to finish do + c <- n + + let annotatedStart (start: unativeint) finish = + for n = start to finish do + c <- n + + let annotatedFinish start (finish: unativeint) = + for n = start to finish do + c <- n + + let inferredStartAndFinish start finish = + for n = start to finish do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl new file mode 100644 index 00000000000..437e2c41f49 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/ForLoopUIntPtr.fs.RealInternalSignatureOn.OptimizeOn.il.bsl @@ -0,0 +1,771 @@ + + + + + +.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.exe + +.imagebase {value} +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 +.corflags 0x00000001 + + + + + +.class public abstract auto ansi sealed assembly + 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 ) + .class abstract auto ansi sealed nested public Up + 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 constEmpty() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0xa + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0x0 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void constNonEmpty() cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1) + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stloc.0 + IL_000b: ldc.i8 0x1 + IL_0014: conv.u + IL_0015: stloc.1 + IL_0016: br.s IL_0038 + + IL_0018: ldloc.1 + IL_0019: call void assembly::set_c(native uint) + IL_001e: ldloc.1 + IL_001f: ldc.i8 0x1 + IL_0028: conv.u + IL_0029: add + IL_002a: stloc.1 + IL_002b: ldloc.0 + IL_002c: ldc.i8 0x1 + IL_0035: conv.u + IL_0036: add + IL_0037: stloc.0 + IL_0038: ldloc.0 + IL_0039: ldc.i8 0xa + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void constFinish(native uint start) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + bool V_1, + native uint V_2, + native uint V_3, + native uint V_4) + IL_0000: ldc.i8 0xa + IL_0009: conv.u + IL_000a: ldarg.0 + IL_000b: bge.un.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldc.i8 0xa + IL_0023: conv.u + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_0094 + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.u + IL_005d: stloc.2 + IL_005e: ldarg.0 + IL_005f: stloc.3 + IL_0060: br.s IL_0090 + + IL_0062: ldloc.3 + IL_0063: call void assembly::set_c(native uint) + IL_0068: ldloc.3 + IL_0069: ldc.i8 0x1 + IL_0072: conv.u + IL_0073: add + IL_0074: stloc.3 + IL_0075: ldloc.2 + IL_0076: ldc.i8 0x1 + IL_007f: conv.u + IL_0080: add + IL_0081: stloc.2 + IL_0082: ldloc.2 + IL_0083: ldc.i8 0x0 + IL_008c: conv.u + IL_008d: cgt.un + IL_008f: stloc.1 + IL_0090: ldloc.1 + IL_0091: brtrue.s IL_0062 + + IL_0093: ret + + IL_0094: ldc.i8 0xa + IL_009d: conv.u + IL_009e: ldarg.0 + IL_009f: bge.un.s IL_00ae + + IL_00a1: ldc.i8 0x0 + IL_00aa: conv.u + IL_00ab: nop + IL_00ac: br.s IL_00c6 + + IL_00ae: ldc.i8 0xa + IL_00b7: conv.u + IL_00b8: ldarg.0 + IL_00b9: sub + IL_00ba: ldc.i8 0x1 + IL_00c3: conv.u + IL_00c4: add.ovf.un + IL_00c5: nop + IL_00c6: stloc.2 + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.u + IL_00d1: stloc.3 + IL_00d2: ldarg.0 + IL_00d3: stloc.s V_4 + IL_00d5: br.s IL_00fa + + IL_00d7: ldloc.s V_4 + IL_00d9: call void assembly::set_c(native uint) + IL_00de: ldloc.s V_4 + IL_00e0: ldc.i8 0x1 + IL_00e9: conv.u + IL_00ea: add + IL_00eb: stloc.s V_4 + IL_00ed: ldloc.3 + IL_00ee: ldc.i8 0x1 + IL_00f7: conv.u + IL_00f8: add + IL_00f9: stloc.3 + IL_00fa: ldloc.3 + IL_00fb: ldloc.2 + IL_00fc: blt.un.s IL_00d7 + + IL_00fe: ret + } + + .method public static void constStart(native uint finish) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + bool V_1, + native uint V_2, + native uint V_3, + native uint V_4) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x1 + IL_000a: conv.u + IL_000b: bge.un.s IL_001a + + IL_000d: ldc.i8 0x0 + IL_0016: conv.u + IL_0017: nop + IL_0018: br.s IL_0027 + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.u + IL_0025: sub + IL_0026: nop + IL_0027: stloc.0 + IL_0028: sizeof [runtime]System.IntPtr + IL_002e: ldc.i4.4 + IL_002f: bne.un.s IL_0041 + + IL_0031: ldloc.0 + IL_0032: ldc.i8 0xffffffff + IL_003b: conv.u + IL_003c: ceq + IL_003e: nop + IL_003f: br.s IL_004f + + IL_0041: ldloc.0 + IL_0042: ldc.i8 0xffffffffffffffff + IL_004b: conv.u + IL_004c: ceq + IL_004e: nop + IL_004f: brfalse.s IL_009d + + IL_0051: ldc.i4.1 + IL_0052: stloc.1 + IL_0053: ldc.i8 0x0 + IL_005c: conv.u + IL_005d: stloc.2 + IL_005e: ldc.i8 0x1 + IL_0067: conv.u + IL_0068: stloc.3 + IL_0069: br.s IL_0099 + + IL_006b: ldloc.3 + IL_006c: call void assembly::set_c(native uint) + IL_0071: ldloc.3 + IL_0072: ldc.i8 0x1 + IL_007b: conv.u + IL_007c: add + IL_007d: stloc.3 + IL_007e: ldloc.2 + IL_007f: ldc.i8 0x1 + IL_0088: conv.u + IL_0089: add + IL_008a: stloc.2 + IL_008b: ldloc.2 + IL_008c: ldc.i8 0x0 + IL_0095: conv.u + IL_0096: cgt.un + IL_0098: stloc.1 + IL_0099: ldloc.1 + IL_009a: brtrue.s IL_006b + + IL_009c: ret + + IL_009d: ldarg.0 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: bge.un.s IL_00b7 + + IL_00aa: ldc.i8 0x0 + IL_00b3: conv.u + IL_00b4: nop + IL_00b5: br.s IL_00cf + + IL_00b7: ldarg.0 + IL_00b8: ldc.i8 0x1 + IL_00c1: conv.u + IL_00c2: sub + IL_00c3: ldc.i8 0x1 + IL_00cc: conv.u + IL_00cd: add.ovf.un + IL_00ce: nop + IL_00cf: stloc.2 + IL_00d0: ldc.i8 0x0 + IL_00d9: conv.u + IL_00da: stloc.3 + IL_00db: ldc.i8 0x1 + IL_00e4: conv.u + IL_00e5: stloc.s V_4 + IL_00e7: br.s IL_010c + + IL_00e9: ldloc.s V_4 + IL_00eb: call void assembly::set_c(native uint) + IL_00f0: ldloc.s V_4 + IL_00f2: ldc.i8 0x1 + IL_00fb: conv.u + IL_00fc: add + IL_00fd: stloc.s V_4 + IL_00ff: ldloc.3 + IL_0100: ldc.i8 0x1 + IL_0109: conv.u + IL_010a: add + IL_010b: stloc.3 + IL_010c: ldloc.3 + IL_010d: ldloc.2 + IL_010e: blt.un.s IL_00e9 + + IL_0110: ret + } + + .method public static void annotatedStart(native uint start, + native uint finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native uint V_0, + bool V_1, + native uint V_2, + native uint V_3, + native uint V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.u + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.u + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native uint) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.u + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.u + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.u + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.un.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.u + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.u + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.u + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native uint) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.u + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.u + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + .method public static void annotatedFinish(native uint start, + native uint finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native uint V_0, + bool V_1, + native uint V_2, + native uint V_3, + native uint V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.u + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.u + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native uint) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.u + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.u + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.u + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.un.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.u + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.u + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.u + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native uint) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.u + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.u + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + .method public static void inferredStartAndFinish(native uint start, + native uint finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 02 00 00 00 01 00 00 00 01 00 00 00 00 00 ) + + .maxstack 4 + .locals init (native uint V_0, + bool V_1, + native uint V_2, + native uint V_3, + native uint V_4) + IL_0000: ldarg.1 + IL_0001: ldarg.0 + IL_0002: bge.un.s IL_0011 + + IL_0004: ldc.i8 0x0 + IL_000d: conv.u + IL_000e: nop + IL_000f: br.s IL_0015 + + IL_0011: ldarg.1 + IL_0012: ldarg.0 + IL_0013: sub + IL_0014: nop + IL_0015: stloc.0 + IL_0016: sizeof [runtime]System.IntPtr + IL_001c: ldc.i4.4 + IL_001d: bne.un.s IL_002f + + IL_001f: ldloc.0 + IL_0020: ldc.i8 0xffffffff + IL_0029: conv.u + IL_002a: ceq + IL_002c: nop + IL_002d: br.s IL_003d + + IL_002f: ldloc.0 + IL_0030: ldc.i8 0xffffffffffffffff + IL_0039: conv.u + IL_003a: ceq + IL_003c: nop + IL_003d: brfalse.s IL_0082 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i8 0x0 + IL_004a: conv.u + IL_004b: stloc.2 + IL_004c: ldarg.0 + IL_004d: stloc.3 + IL_004e: br.s IL_007e + + IL_0050: ldloc.3 + IL_0051: call void assembly::set_c(native uint) + IL_0056: ldloc.3 + IL_0057: ldc.i8 0x1 + IL_0060: conv.u + IL_0061: add + IL_0062: stloc.3 + IL_0063: ldloc.2 + IL_0064: ldc.i8 0x1 + IL_006d: conv.u + IL_006e: add + IL_006f: stloc.2 + IL_0070: ldloc.2 + IL_0071: ldc.i8 0x0 + IL_007a: conv.u + IL_007b: cgt.un + IL_007d: stloc.1 + IL_007e: ldloc.1 + IL_007f: brtrue.s IL_0050 + + IL_0081: ret + + IL_0082: ldarg.1 + IL_0083: ldarg.0 + IL_0084: bge.un.s IL_0093 + + IL_0086: ldc.i8 0x0 + IL_008f: conv.u + IL_0090: nop + IL_0091: br.s IL_00a2 + + IL_0093: ldarg.1 + IL_0094: ldarg.0 + IL_0095: sub + IL_0096: ldc.i8 0x1 + IL_009f: conv.u + IL_00a0: add.ovf.un + IL_00a1: nop + IL_00a2: stloc.2 + IL_00a3: ldc.i8 0x0 + IL_00ac: conv.u + IL_00ad: stloc.3 + IL_00ae: ldarg.0 + IL_00af: stloc.s V_4 + IL_00b1: br.s IL_00d6 + + IL_00b3: ldloc.s V_4 + IL_00b5: call void assembly::set_c(native uint) + IL_00ba: ldloc.s V_4 + IL_00bc: ldc.i8 0x1 + IL_00c5: conv.u + IL_00c6: add + IL_00c7: stloc.s V_4 + IL_00c9: ldloc.3 + IL_00ca: ldc.i8 0x1 + IL_00d3: conv.u + IL_00d4: add + IL_00d5: stloc.3 + IL_00d6: ldloc.3 + IL_00d7: ldloc.2 + IL_00d8: blt.un.s IL_00b3 + + IL_00da: ret + } + + } + + .field static assembly native uint c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .method public specialname static native uint get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld native uint assembly::c@1 + IL_0005: ret + } + + .method public specialname static void set_c(native uint 'value') cil managed + { + + .maxstack 8 + IL_0000: ldarg.0 + IL_0001: stsfld native uint assembly::c@1 + IL_0006: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 8 + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::init@ + IL_0006: ldsfld int32 ''.$assembly::init@ + IL_000b: pop + IL_000c: ret + } + + .method assembly specialname static void staticInitialization@() cil managed + { + + .maxstack 8 + IL_0000: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stsfld native uint assembly::c@1 + IL_000f: ret + } + + .property native uint c() + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 ) + .set void assembly::set_c(native uint) + .get native uint assembly::get_c() + } +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .field static assembly int32 init@ + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: call void assembly::staticInitialization@() + IL_0005: ret + } + +} + + + + + +