diff --git a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md index 35cb6319ddc..148f3734185 100644 --- a/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md +++ b/docs/release-notes/.FSharp.Compiler.Service/8.0.300.md @@ -36,3 +36,4 @@ * Reverted [#16348](https://github.com/dotnet/fsharp/pull/16348) `ThreadStatic` `CancellationToken` changes to improve test stability and prevent potential unwanted cancellations. ([PR #16536](https://github.com/dotnet/fsharp/pull/16536)) * Refactored parenthesization API. ([PR #16461])(https://github.com/dotnet/fsharp/pull/16461)) * Optimize some interpolated strings by lowering to string concatenation. ([PR #16556](https://github.com/dotnet/fsharp/pull/16556)) +* Integral range optimizations. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650)) diff --git a/docs/release-notes/.Language/preview.md b/docs/release-notes/.Language/preview.md index a4dd48f213d..eb7ddd08e54 100644 --- a/docs/release-notes/.Language/preview.md +++ b/docs/release-notes/.Language/preview.md @@ -1,5 +1,6 @@ ### Added +* Lower integral ranges to fast loops in more cases and optimize list and array construction from ranges. ([PR #16650](https://github.com/dotnet/fsharp/pull/16650)) * Better generic unmanaged structs handling. ([Language suggestion #692](https://github.com/fsharp/fslang-suggestions/issues/692), [PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Bidirectional F#/C# interop for 'unmanaged' constraint. ([PR #12154](https://github.com/dotnet/fsharp/pull/12154)) * Make `.Is*` discriminated union properties visible. ([Language suggestion #222](https://github.com/fsharp/fslang-suggestions/issues/222), [PR #16341](https://github.com/dotnet/fsharp/pull/16341)) diff --git a/src/Compiler/FSComp.txt b/src/Compiler/FSComp.txt index 52a5a184823..5846712049b 100644 --- a/src/Compiler/FSComp.txt +++ b/src/Compiler/FSComp.txt @@ -1597,6 +1597,7 @@ featureBooleanReturningAndReturnTypeDirectedPartialActivePattern,"Boolean-return featureEnforceAttributeTargetsOnFunctions,"Enforce AttributeTargets on functions" featureEnforceAttributeTargetsUnionCaseDeclarations,"Enforce AttributeTargets on union case declarations" featureLowerInterpolatedStringToConcat,"Optimizes interpolated strings in certain cases, by lowering to concatenation" +featureLowerIntegralRangesToFastLoops,"Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops." 3354,tcNotAFunctionButIndexerNamedIndexingNotYetEnabled,"This value supports indexing, e.g. '%s.[index]'. The syntax '%s[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3354,tcNotAFunctionButIndexerIndexingNotYetEnabled,"This expression supports indexing, e.g. 'expr.[index]'. The syntax 'expr[index]' requires /langversion:preview. See https://aka.ms/fsharp-index-notation." 3355,tcNotAnIndexerNamedIndexingNotYetEnabled,"The value '%s' is not a function and does not support index notation." diff --git a/src/Compiler/Facilities/LanguageFeatures.fs b/src/Compiler/Facilities/LanguageFeatures.fs index dd7133224e8..3103d8b159e 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fs +++ b/src/Compiler/Facilities/LanguageFeatures.fs @@ -88,6 +88,7 @@ type LanguageFeature = | EnforceAttributeTargetsOnFunctions | EnforceAttributeTargetsUnionCaseDeclarations | LowerInterpolatedStringToConcat + | LowerIntegralRangesToFastLoops /// LanguageVersion management type LanguageVersion(versionText) = @@ -203,6 +204,7 @@ type LanguageVersion(versionText) = LanguageFeature.EnforceAttributeTargetsOnFunctions, previewVersion LanguageFeature.EnforceAttributeTargetsUnionCaseDeclarations, previewVersion LanguageFeature.LowerInterpolatedStringToConcat, previewVersion + LanguageFeature.LowerIntegralRangesToFastLoops, previewVersion ] static let defaultLanguageVersion = LanguageVersion("default") @@ -349,6 +351,7 @@ type LanguageVersion(versionText) = | LanguageFeature.EnforceAttributeTargetsOnFunctions -> FSComp.SR.featureEnforceAttributeTargetsOnFunctions () | LanguageFeature.EnforceAttributeTargetsUnionCaseDeclarations -> FSComp.SR.featureEnforceAttributeTargetsUnionCaseDeclarations () | LanguageFeature.LowerInterpolatedStringToConcat -> FSComp.SR.featureLowerInterpolatedStringToConcat () + | LanguageFeature.LowerIntegralRangesToFastLoops -> FSComp.SR.featureLowerIntegralRangesToFastLoops () /// Get a version string associated with the given feature. static member GetFeatureVersionString feature = diff --git a/src/Compiler/Facilities/LanguageFeatures.fsi b/src/Compiler/Facilities/LanguageFeatures.fsi index 5be15a88284..4f0fe835ffa 100644 --- a/src/Compiler/Facilities/LanguageFeatures.fsi +++ b/src/Compiler/Facilities/LanguageFeatures.fsi @@ -79,6 +79,7 @@ type LanguageFeature = | EnforceAttributeTargetsOnFunctions | EnforceAttributeTargetsUnionCaseDeclarations | LowerInterpolatedStringToConcat + | LowerIntegralRangesToFastLoops /// LanguageVersion management type LanguageVersion = diff --git a/src/Compiler/Optimize/LowerComputedCollections.fs b/src/Compiler/Optimize/LowerComputedCollections.fs index 2de57119ff3..7ceff0a676c 100644 --- a/src/Compiler/Optimize/LowerComputedCollections.fs +++ b/src/Compiler/Optimize/LowerComputedCollections.fs @@ -2,9 +2,10 @@ module internal FSharp.Compiler.LowerComputedCollectionExpressions -open Internal.Utilities.Library +open FSharp.Compiler.AbstractIL.IL open FSharp.Compiler.AccessibilityLogic open FSharp.Compiler.DiagnosticsLogger +open FSharp.Compiler.Features open FSharp.Compiler.InfoReader open FSharp.Compiler.LowerSequenceExpressions open FSharp.Compiler.MethodCalls @@ -255,18 +256,178 @@ let (|SeqToArray|_|) g expr = | ValApp g g.seq_to_array_vref (_, [seqExpr], m) -> ValueSome (seqExpr, m) | _ -> ValueNone +module List = + /// Makes an expression that will build a list from an integral range. + let mkFromIntegralRange tcVal (g: TcGlobals) amap m overallElemTy overallSeqExpr start step finish = + let collectorTy = g.mk_ListCollector_ty overallElemTy + + /// let collector = ListCollector () in + /// + /// collector.Close () + let mkListInit mkLoop = + mkCompGenLetMutableIn m "collector" collectorTy (mkDefault (m, collectorTy)) (fun (_, collector) -> + let reader = InfoReader (g, amap) + let loop = mkLoop (fun _idxVar loopVar -> mkCallCollectorAdd tcVal g reader m collector loopVar) + let close = mkCallCollectorClose tcVal g reader m collector + mkSequential m loop close + ) + + mkOptimizedRangeLoop + g + (m, m, m, DebugPointAtWhile.No) + (overallElemTy, overallSeqExpr) + (start, step, finish) + (fun count mkLoop -> + match count with + | Expr.Const (value = IntegralConst.Zero) -> + mkNil g m overallElemTy + + | Expr.Const (value = _nonzeroConstant) -> + mkListInit mkLoop + + | _dynamicCount -> + mkListInit mkLoop + ) + +module Array = + /// Whether to check for overflow when converting a value to a native int. + [] + type Ovf = + /// Check for overflow. We need this when passing the count into newarr. + | CheckOvf + + /// Don't check for overflow. We don't need to check when indexing into the array, + /// since we already know count didn't overflow during initialization. + | NoCheckOvf + + /// Makes an expression that will build an array from an integral range. + let mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish = + let arrayTy = mkArrayType g overallElemTy + + let convToNativeInt ovf expr = + let ty = stripMeasuresFromTy g (tyOfExpr g expr) + + let conv = + match ovf with + | NoCheckOvf -> AI_conv DT_I + | CheckOvf when isSignedIntegerTy g ty -> AI_conv_ovf DT_I + | CheckOvf -> AI_conv_ovf_un DT_I + + if typeEquiv g ty g.int64_ty then + mkAsmExpr ([conv], [], [expr], [g.nativeint_ty], m) + elif typeEquiv g ty g.nativeint_ty then + mkAsmExpr ([conv], [], [mkAsmExpr ([AI_conv DT_I8], [], [expr], [g.int64_ty], m)], [g.nativeint_ty], m) + elif typeEquiv g ty g.uint64_ty then + mkAsmExpr ([conv], [], [expr], [g.nativeint_ty], m) + elif typeEquiv g ty g.unativeint_ty then + mkAsmExpr ([conv], [], [mkAsmExpr ([AI_conv DT_U8], [], [expr], [g.uint64_ty], m)], [g.nativeint_ty], m) + else + expr + + let ilTy, ilBasicTy = + let ty = stripMeasuresFromTy g overallElemTy + + if typeEquiv g ty g.int32_ty then g.ilg.typ_Int32, DT_I4 + elif typeEquiv g ty g.int64_ty then g.ilg.typ_Int64, DT_I8 + elif typeEquiv g ty g.uint64_ty then g.ilg.typ_UInt64, DT_U8 + elif typeEquiv g ty g.uint32_ty then g.ilg.typ_UInt32, DT_U4 + elif typeEquiv g ty g.nativeint_ty then g.ilg.typ_IntPtr, DT_I + elif typeEquiv g ty g.unativeint_ty then g.ilg.typ_UIntPtr, DT_U + elif typeEquiv g ty g.int16_ty then g.ilg.typ_Int16, DT_I2 + elif typeEquiv g ty g.uint16_ty then g.ilg.typ_UInt16, DT_U2 + elif typeEquiv g ty g.sbyte_ty then g.ilg.typ_SByte, DT_I1 + elif typeEquiv g ty g.byte_ty then g.ilg.typ_Byte, DT_U1 + elif typeEquiv g ty g.char_ty then g.ilg.typ_Char, DT_U2 + else error (InternalError ($"Unable to find IL type for integral type '{overallElemTy}'.", m)) + + /// (# "newarr !0" type ('T) count : 'T array #) + let mkNewArray count = + mkAsmExpr + ( + [I_newarr (ILArrayShape.SingleDimensional, ilTy)], + [], + [convToNativeInt CheckOvf count], + [arrayTy], + m + ) + + /// let array = (# "newarr !0" type ('T) count : 'T array #) in + /// + /// array + let mkArrayInit count mkLoop = + mkCompGenLetIn m "array" arrayTy (mkNewArray count) (fun (_, array) -> + let loop = mkLoop (fun idxVar loopVar -> mkAsmExpr ([I_stelem ilBasicTy], [], [array; convToNativeInt NoCheckOvf idxVar; loopVar], [], m)) + mkSequential m loop array) + + mkOptimizedRangeLoop + g + (m, m, m, DebugPointAtWhile.No) + (overallElemTy, overallSeqExpr) + (start, step, finish) + (fun count mkLoop -> + match count with + | Expr.Const (value = IntegralConst.Zero) -> + mkArray (overallElemTy, [], m) + + | Expr.Const (value = _nonzeroConstant) -> + mkArrayInit count mkLoop + + | _dynamicCount -> + mkCompGenLetIn m (nameof count) (tyOfExpr g count) count (fun (_, count) -> + let countTy = tyOfExpr g count + + // count < 1 + let countLtOne = + if isSignedIntegerTy g countTy then + mkILAsmClt g m count (mkTypedOne g m countTy) + else + mkAsmExpr ([AI_clt_un], [], [count; mkTypedOne g m countTy], [g.bool_ty], m) + + // if count < 1 then + // [||] + // else + // let array = (# "newarr !0" type ('T) count : 'T array #) in + // + // array + mkCond + DebugPointAtBinding.NoneAtInvisible + m + arrayTy + countLtOne + (mkArray (overallElemTy, [], m)) + (mkArrayInit count mkLoop) + ) + ) + let LowerComputedListOrArrayExpr tcVal (g: TcGlobals) amap overallExpr = // If ListCollector is in FSharp.Core then this optimization kicks in if g.ListCollector_tcr.CanDeref then - match overallExpr with + // […] | SeqToList g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> - let collectorTy = g.mk_ListCollector_ty overallElemTy - LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr - + match overallSeqExpr with + // [start..finish] + // [start..step..finish] + | IntegralRange g (_, (start, step, finish)) when g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops -> + Some (List.mkFromIntegralRange tcVal g amap m overallElemTy overallSeqExpr start step finish) + + // [(* Anything more complex. *)] + | _ -> + let collectorTy = g.mk_ListCollector_ty overallElemTy + LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr + + // [|…|] | SeqToArray g (OptionalCoerce (OptionalSeq g amap (overallSeqExpr, overallElemTy)), m) -> - let collectorTy = g.mk_ArrayCollector_ty overallElemTy - LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr + match overallSeqExpr with + // [|start..finish|] + // [|start..step..finish|] + | IntegralRange g (_, (start, step, finish)) when g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops -> + Some (Array.mkFromIntegralRange g m overallElemTy overallSeqExpr start step finish) + + // [|(* Anything more complex. *)|] + | _ -> + let collectorTy = g.mk_ArrayCollector_ty overallElemTy + LowerComputedListOrArraySeqExpr tcVal g amap m collectorTy overallSeqExpr | _ -> None else diff --git a/src/Compiler/TypedTree/TcGlobals.fs b/src/Compiler/TypedTree/TcGlobals.fs index 4f713fb4d5d..b1758206a44 100644 --- a/src/Compiler/TypedTree/TcGlobals.fs +++ b/src/Compiler/TypedTree/TcGlobals.fs @@ -810,6 +810,18 @@ type TcGlobals( let v_range_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_Range" , None , None , [vara], ([[varaTy];[varaTy]], mkSeqTy varaTy)) let v_range_step_op_info = makeIntrinsicValRef(fslib_MFOperators_nleref, "op_RangeStep" , None , None , [vara;varb], ([[varaTy];[varbTy];[varaTy]], mkSeqTy varaTy)) let v_range_int32_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt32" , None , None , [], ([[v_int_ty];[v_int_ty];[v_int_ty]], mkSeqTy v_int_ty)) + let v_range_int64_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt64" , None , None , [], ([[v_int64_ty];[v_int64_ty];[v_int64_ty]], mkSeqTy v_int64_ty)) + let v_range_uint64_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUInt64" , None , None , [], ([[v_uint64_ty];[v_uint64_ty];[v_uint64_ty]], mkSeqTy v_uint64_ty)) + let v_range_uint32_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUInt32" , None , None , [], ([[v_uint32_ty];[v_uint32_ty];[v_uint32_ty]], mkSeqTy v_uint32_ty)) + let v_range_nativeint_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeIntPtr" , None , None , [], ([[v_nativeint_ty];[v_nativeint_ty];[v_nativeint_ty]], mkSeqTy v_nativeint_ty)) + let v_range_unativeint_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUIntPtr" , None , None , [], ([[v_unativeint_ty];[v_unativeint_ty];[v_unativeint_ty]], mkSeqTy v_unativeint_ty)) + let v_range_int16_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeInt16" , None , None , [], ([[v_int16_ty];[v_int16_ty];[v_int16_ty]], mkSeqTy v_int16_ty)) + let v_range_uint16_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeUInt16" , None , None , [], ([[v_uint16_ty];[v_uint16_ty];[v_uint16_ty]], mkSeqTy v_uint16_ty)) + let v_range_sbyte_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeSByte" , None , None , [], ([[v_sbyte_ty];[v_sbyte_ty];[v_sbyte_ty]], mkSeqTy v_sbyte_ty)) + let v_range_byte_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeByte" , None , None , [], ([[v_byte_ty];[v_byte_ty];[v_byte_ty]], mkSeqTy v_byte_ty)) + let v_range_char_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeChar" , None , None , [], ([[v_char_ty];[v_char_ty];[v_char_ty]], mkSeqTy v_char_ty)) + let v_range_generic_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeGeneric" , None , None , [vara], ([[varaTy];[varaTy]], mkSeqTy varaTy)) + let v_range_step_generic_op_info = makeIntrinsicValRef(fslib_MFOperatorIntrinsics_nleref, "RangeStepGeneric" , None , None , [vara;varb], ([[varaTy];[varbTy];[varaTy]], mkSeqTy varaTy)) let v_array_length_info = makeIntrinsicValRef(fslib_MFArrayModule_nleref, "length" , None , Some "Length" , [vara], ([[mkArrayType 1 varaTy]], v_int_ty)) let v_array_get_info = makeIntrinsicValRef(fslib_MFIntrinsicFunctions_nleref, "GetArray" , None , None , [vara], ([[mkArrayType 1 varaTy]; [v_int_ty]], varaTy)) @@ -1690,6 +1702,18 @@ type TcGlobals( member val range_op_vref = ValRefForIntrinsic v_range_op_info member val range_step_op_vref = ValRefForIntrinsic v_range_step_op_info member val range_int32_op_vref = ValRefForIntrinsic v_range_int32_op_info + member val range_int64_op_vref = ValRefForIntrinsic v_range_int64_op_info + member val range_uint64_op_vref = ValRefForIntrinsic v_range_uint64_op_info + member val range_uint32_op_vref = ValRefForIntrinsic v_range_uint32_op_info + member val range_nativeint_op_vref = ValRefForIntrinsic v_range_nativeint_op_info + member val range_unativeint_op_vref = ValRefForIntrinsic v_range_unativeint_op_info + member val range_int16_op_vref = ValRefForIntrinsic v_range_int16_op_info + member val range_uint16_op_vref = ValRefForIntrinsic v_range_uint16_op_info + member val range_sbyte_op_vref = ValRefForIntrinsic v_range_sbyte_op_info + member val range_byte_op_vref = ValRefForIntrinsic v_range_byte_op_info + member val range_char_op_vref = ValRefForIntrinsic v_range_char_op_info + member val range_generic_op_vref = ValRefForIntrinsic v_range_generic_op_info + member val range_step_generic_op_vref = ValRefForIntrinsic v_range_step_generic_op_info member val array_get_vref = ValRefForIntrinsic v_array_get_info member val array2D_get_vref = ValRefForIntrinsic v_array2D_get_info member val array3D_get_vref = ValRefForIntrinsic v_array3D_get_info diff --git a/src/Compiler/TypedTree/TypedTreeOps.fs b/src/Compiler/TypedTree/TypedTreeOps.fs index 68b924df6a2..8001c049ece 100644 --- a/src/Compiler/TypedTree/TypedTreeOps.fs +++ b/src/Compiler/TypedTree/TypedTreeOps.fs @@ -7416,6 +7416,42 @@ let mkTwo g m = mkInt g m 2 let mkMinusOne g m = mkInt g m -1 +let mkTypedZero g m ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 0, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 0L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 0UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 0u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 0L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 0UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 0s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 0us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 0y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 0uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\000', m, ty) + elif typeEquiv g underlyingTy g.float32_ty then Expr.Const (Const.Single 0.0f, m, ty) + elif typeEquiv g underlyingTy g.float_ty then Expr.Const (Const.Double 0.0, m, ty) + elif typeEquiv g underlyingTy g.decimal_ty then Expr.Const (Const.Decimal 0m, m, ty) + else error (InternalError ($"Unrecognized numeric type '{ty}'.", m)) + +let mkTypedOne g m ty = + let underlyingTy = stripMeasuresFromTy g ty + if typeEquiv g underlyingTy g.int32_ty then Expr.Const (Const.Int32 1, m, ty) + elif typeEquiv g underlyingTy g.int64_ty then Expr.Const (Const.Int64 1L, m, ty) + elif typeEquiv g underlyingTy g.uint64_ty then Expr.Const (Const.UInt64 1UL, m, ty) + elif typeEquiv g underlyingTy g.uint32_ty then Expr.Const (Const.UInt32 1u, m, ty) + elif typeEquiv g underlyingTy g.nativeint_ty then Expr.Const (Const.IntPtr 1L, m, ty) + elif typeEquiv g underlyingTy g.unativeint_ty then Expr.Const (Const.UIntPtr 1UL, m, ty) + elif typeEquiv g underlyingTy g.int16_ty then Expr.Const (Const.Int16 1s, m, ty) + elif typeEquiv g underlyingTy g.uint16_ty then Expr.Const (Const.UInt16 1us, m, ty) + elif typeEquiv g underlyingTy g.sbyte_ty then Expr.Const (Const.SByte 1y, m, ty) + elif typeEquiv g underlyingTy g.byte_ty then Expr.Const (Const.Byte 1uy, m, ty) + elif typeEquiv g underlyingTy g.char_ty then Expr.Const (Const.Char '\001', m, ty) + elif typeEquiv g underlyingTy g.float32_ty then Expr.Const (Const.Single 1.0f, m, ty) + elif typeEquiv g underlyingTy g.float_ty then Expr.Const (Const.Double 1.0, m, ty) + elif typeEquiv g underlyingTy g.decimal_ty then Expr.Const (Const.Decimal 1m, m, ty) + else error (InternalError ($"Unrecognized numeric type '{ty}'.", m)) + let destInt32 = function Expr.Const (Const.Int32 n, _, _) -> Some n | _ -> None let isIDelegateEventType g ty = @@ -8339,6 +8375,10 @@ let mkCompGenLetIn m nm ty e f = let v, ve = mkCompGenLocal m nm ty mkCompGenLet m v e (f (v, ve)) +let mkCompGenLetMutableIn m nm ty e f = + let v, ve = mkMutableCompGenLocal m nm ty + mkCompGenLet m v e (f (v, ve)) + /// Take a node representing a coercion from one function type to another, e.g. /// A -> A * A -> int /// to @@ -10108,7 +10148,7 @@ let (|CompiledForEachExpr|_|) g expr = Some (enumerableTy, enumerableExpr, elemVar, bodyExpr, (mBody, spFor, spIn, mFor, mIn, spInWhile, mWholeExpr)) | _ -> None - + let (|CompiledInt32RangeForEachExpr|_|) g expr = match expr with @@ -10116,6 +10156,724 @@ let (|CompiledInt32RangeForEachExpr|_|) g expr = Some (startExpr, step, finishExpr, elemVar, bodyExpr, ranges) | _ -> None +let (|ValApp|_|) g vref expr = + match expr with + | Expr.App (Expr.Val (vref2, _, _), _f0ty, tyargs, args, m) when valRefEq g vref vref2 -> Some (tyargs, args, m) + | _ -> None + +[] +module IntegralConst = + /// Constant 0. + [] + let (|Zero|_|) c = + match c with + | Const.Zero + | Const.Int32 0 + | Const.Int64 0L + | Const.UInt64 0UL + | Const.UInt32 0u + | Const.IntPtr 0L + | Const.UIntPtr 0UL + | Const.Int16 0s + | Const.UInt16 0us + | Const.SByte 0y + | Const.Byte 0uy + | Const.Char '\000' -> ValueSome Zero + | _ -> ValueNone + + /// Constant 1. + [] + let (|One|_|) expr = + match expr with + | Const.Int32 1 + | Const.Int64 1L + | Const.UInt64 1UL + | Const.UInt32 1u + | Const.IntPtr 1L + | Const.UIntPtr 1UL + | Const.Int16 1s + | Const.UInt16 1us + | Const.SByte 1y + | Const.Byte 1uy + | Const.Char '\001' -> ValueSome One + | _ -> ValueNone + + /// Constant -1. + [] + let (|MinusOne|_|) c = + match c with + | Const.Int32 -1 + | Const.Int64 -1L + | Const.IntPtr -1L + | Const.Int16 -1s + | Const.SByte -1y -> ValueSome MinusOne + | _ -> ValueNone + + /// Positive constant. + [] + let (|Positive|_|) c = + match c with + | Const.Int32 v when v > 0 -> ValueSome Positive + | Const.Int64 v when v > 0L -> ValueSome Positive + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Const.IntPtr v when v > 0L && uint64 v < 0x80000000UL -> ValueSome Positive + | Const.Int16 v when v > 0s -> ValueSome Positive + | Const.SByte v when v > 0y -> ValueSome Positive + | Const.UInt64 v when v > 0UL -> ValueSome Positive + | Const.UInt32 v when v > 0u -> ValueSome Positive + // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. + | Const.UIntPtr v when v > 0UL && v <= 0xffffffffUL -> ValueSome Positive + | Const.UInt16 v when v > 0us -> ValueSome Positive + | Const.Byte v when v > 0uy -> ValueSome Positive + | Const.Char v when v > '\000' -> ValueSome Positive + | _ -> ValueNone + + /// Negative constant. + [] + let (|Negative|_|) c = + match c with + | Const.Int32 v when v < 0 -> ValueSome Negative + | Const.Int64 v when v < 0L -> ValueSome Negative + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Const.IntPtr v when v < 0L && uint64 v < 0x80000000UL -> ValueSome Negative + | Const.Int16 v when v < 0s -> ValueSome Negative + | Const.SByte v when v < 0y -> ValueSome Negative + | _ -> ValueNone + + /// Returns the absolute value of the given integral constant. + let abs c = + match c with + | Const.Int32 Int32.MinValue -> Const.UInt32 (uint Int32.MaxValue + 1u) + | Const.Int64 Int64.MinValue -> Const.UInt64 (uint64 Int64.MaxValue + 1UL) + | Const.IntPtr Int64.MinValue -> Const.UIntPtr (uint64 Int64.MaxValue + 1UL) + | Const.Int16 Int16.MinValue -> Const.UInt16 (uint16 Int16.MaxValue + 1us) + | Const.SByte SByte.MinValue -> Const.Byte (byte SByte.MaxValue + 1uy) + | Const.Int32 v -> Const.Int32 (abs v) + | Const.Int64 v -> Const.Int64 (abs v) + | Const.IntPtr v -> Const.IntPtr (abs v) + | Const.Int16 v -> Const.Int16 (abs v) + | Const.SByte v -> Const.SByte (abs v) + | _ -> c + +/// start..finish +/// start..step..finish +[] +let (|IntegralRange|_|) g expr = + match expr with + | ValApp g g.range_int32_op_vref ([], [start; step; finish], _) -> ValueSome (g.int32_ty, (start, step, finish)) + | ValApp g g.range_int64_op_vref ([], [start; step; finish], _) -> ValueSome (g.int64_ty, (start, step, finish)) + | ValApp g g.range_uint64_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint64_ty, (start, step, finish)) + | ValApp g g.range_uint32_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint32_ty, (start, step, finish)) + | ValApp g g.range_nativeint_op_vref ([], [start; step; finish], _) -> ValueSome (g.nativeint_ty, (start, step, finish)) + | ValApp g g.range_unativeint_op_vref ([], [start; step; finish], _) -> ValueSome (g.unativeint_ty, (start, step, finish)) + | ValApp g g.range_int16_op_vref ([], [start; step; finish], _) -> ValueSome (g.int16_ty, (start, step, finish)) + | ValApp g g.range_uint16_op_vref ([], [start; step; finish], _) -> ValueSome (g.uint16_ty, (start, step, finish)) + | ValApp g g.range_sbyte_op_vref ([], [start; step; finish], _) -> ValueSome (g.sbyte_ty, (start, step, finish)) + | ValApp g g.range_byte_op_vref ([], [start; step; finish], _) -> ValueSome (g.byte_ty, (start, step, finish)) + | ValApp g g.range_char_op_vref ([], [start; finish], _) -> ValueSome (g.char_ty, (start, Expr.Const (Const.Char '\001', Text.Range.range0, g.char_ty), finish)) + | ValApp g g.range_op_vref (ty :: _, [start; finish], _) when isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) + | ValApp g g.range_step_op_vref ([ty; ty2], [start; step; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, step, finish)) + | ValApp g g.range_generic_op_vref ([ty; ty2], [_one; _add; start; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, mkTypedOne g Text.Range.range0 ty, finish)) + | ValApp g g.range_step_generic_op_vref ([ty; ty2], [_zero; _add; start; step; finish], _) when typeEquiv g ty ty2 && (isIntegerTy g ty || typeEquivAux EraseMeasures g ty g.char_ty) -> ValueSome (ty, (start, step, finish)) + | _ -> ValueNone + +/// 5..1 +/// 1..-5 +/// 1..-1..5 +/// -5..-1..-1 +/// 5..2..1 +[] +let (|EmptyRange|_|) (start, step, finish) = + match start, step, finish with + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when finish < start && step > 0 || finish > start && step < 0 -> ValueSome EmptyRange + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when finish < start && step > 0L || finish > start && step < 0L -> ValueSome EmptyRange + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 _), Expr.Const (value = Const.UInt64 finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 _), Expr.Const (value = Const.UInt32 finish) when finish < start -> ValueSome EmptyRange + + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when + uint64 start < 0x80000000UL + && uint64 step < 0x80000000UL + && uint64 finish < 0x80000000UL + && (finish < start && step > 0L || finish > start && step < 0L) + -> + ValueSome EmptyRange + + // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) when + start <= 0xffffffffUL + && step <= 0xffffffffUL + && finish <= 0xffffffffUL + && finish <= start + -> + ValueSome EmptyRange + + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when finish < start && step > 0s || finish > start && step < 0s -> ValueSome EmptyRange + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 _), Expr.Const (value = Const.UInt16 finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when finish < start && step > 0y || finish > start && step < 0y -> ValueSome EmptyRange + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte _), Expr.Const (value = Const.Byte finish) when finish < start -> ValueSome EmptyRange + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char _), Expr.Const (value = Const.Char finish) when finish < start -> ValueSome EmptyRange + | _ -> ValueNone + +/// Note: this assumes that an empty range has already been checked for +/// (otherwise the conversion operations here might overflow). +[] +let (|ConstCount|_|) (start, step, finish) = + match start, step, finish with + // The count for these ranges is 2⁶⁴ + 1. We must handle such ranges at runtime. + | Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 1L), Expr.Const (value = Const.Int64 Int64.MaxValue) + | Expr.Const (value = Const.Int64 Int64.MaxValue), Expr.Const (value = Const.Int64 -1L), Expr.Const (value = Const.Int64 Int64.MinValue) + | Expr.Const (value = Const.UInt64 UInt64.MinValue), Expr.Const (value = Const.UInt64 1UL), Expr.Const (value = Const.UInt64 UInt64.MaxValue) + | Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr 1L), Expr.Const (value = Const.IntPtr Int64.MaxValue) + | Expr.Const (value = Const.IntPtr Int64.MaxValue), Expr.Const (value = Const.IntPtr -1L), Expr.Const (value = Const.IntPtr Int64.MinValue) + | Expr.Const (value = Const.UIntPtr UInt64.MinValue), Expr.Const (value = Const.UIntPtr 1UL), Expr.Const (value = Const.UIntPtr UInt64.MaxValue) -> ValueNone + + // We must special-case a step of Int64.MinValue, since we cannot call abs on it. + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 Int64.MinValue), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) when start <= finish -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr Int64.MinValue), Expr.Const (value = Const.IntPtr finish) -> ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / (uint64 Int64.MaxValue + 1UL) + 1UL)) + + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) + | Expr.Const (value = Const.Int64 start), Expr.Const (value = Const.Int64 step), Expr.Const (value = Const.Int64 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) + + // sizeof is not constant, so |𝑐| ≥ 0x80000000n cannot be treated as a constant. + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when + uint64 start < 0x80000000UL + && uint64 step < 0x80000000UL + && uint64 finish < 0x80000000UL + && start <= finish + -> + ValueSome (Const.UIntPtr ((uint64 finish - uint64 start) / uint64 (abs step) + 1UL)) + + | Expr.Const (value = Const.IntPtr start), Expr.Const (value = Const.IntPtr step), Expr.Const (value = Const.IntPtr finish) when + uint64 start < 0x80000000UL + && uint64 step < 0x80000000UL + && uint64 finish < 0x80000000UL + -> + ValueSome (Const.UIntPtr ((uint64 start - uint64 finish) / uint64 (abs step) + 1UL)) + + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) when start <= finish -> ValueSome (Const.UInt64 ((uint64 finish - uint64 start) / uint64 (abs (int64 step)) + 1UL)) + | Expr.Const (value = Const.Int32 start), Expr.Const (value = Const.Int32 step), Expr.Const (value = Const.Int32 finish) -> ValueSome (Const.UInt64 ((uint64 start - uint64 finish) / uint64 (abs (int64 step)) + 1UL)) + + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) when start <= finish -> ValueSome (Const.UInt32 ((uint finish - uint start) / uint (abs (int step)) + 1u)) + | Expr.Const (value = Const.Int16 start), Expr.Const (value = Const.Int16 step), Expr.Const (value = Const.Int16 finish) -> ValueSome (Const.UInt32 ((uint start - uint finish) / uint (abs (int step)) + 1u)) + + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) when start <= finish -> ValueSome (Const.UInt16 ((uint16 finish - uint16 start) / uint16 (abs (int16 step)) + 1us)) + | Expr.Const (value = Const.SByte start), Expr.Const (value = Const.SByte step), Expr.Const (value = Const.SByte finish) -> ValueSome (Const.UInt16 ((uint16 start - uint16 finish) / uint16 (abs (int16 step)) + 1us)) + + // sizeof is not constant, so |𝑐| > 0xffffffffun cannot be treated as a constant. + | Expr.Const (value = Const.UIntPtr start), Expr.Const (value = Const.UIntPtr step), Expr.Const (value = Const.UIntPtr finish) when + start <= 0xffffffffUL + && step <= 0xffffffffUL + && finish <= 0xffffffffUL + -> + ValueSome (Const.UIntPtr ((finish - start) / step + 1UL)) + + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) when start <= finish -> ValueSome (Const.UInt64 ((finish - start) / step + 1UL)) + | Expr.Const (value = Const.UInt64 start), Expr.Const (value = Const.UInt64 step), Expr.Const (value = Const.UInt64 finish) -> ValueSome (Const.UInt64 ((start - finish) / step + 1UL)) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) when start <= finish -> ValueSome (Const.UInt64 (uint64 (finish - start) / uint64 step + 1UL)) + | Expr.Const (value = Const.UInt32 start), Expr.Const (value = Const.UInt32 step), Expr.Const (value = Const.UInt32 finish) -> ValueSome (Const.UInt64 (uint64 (start - finish) / uint64 step + 1UL)) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) when start <= finish -> ValueSome (Const.UInt32 (uint (finish - start) / uint step + 1u)) + | Expr.Const (value = Const.UInt16 start), Expr.Const (value = Const.UInt16 step), Expr.Const (value = Const.UInt16 finish) -> ValueSome (Const.UInt32 (uint (start - finish) / uint step + 1u)) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) when start <= finish -> ValueSome (Const.UInt16 (uint16 (finish - start) / uint16 step + 1us)) + | Expr.Const (value = Const.Byte start), Expr.Const (value = Const.Byte step), Expr.Const (value = Const.Byte finish) -> ValueSome (Const.UInt16 (uint16 (start - finish) / uint16 step + 1us)) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) when start <= finish -> ValueSome (Const.UInt32 (uint (finish - start) / uint step + 1u)) + | Expr.Const (value = Const.Char start), Expr.Const (value = Const.Char step), Expr.Const (value = Const.Char finish) -> ValueSome (Const.UInt32 (uint (start - finish) / uint step + 1u)) + + | _ -> ValueNone + +type Count = Expr +type Idx = Expr +type Elem = Expr +type Body = Expr +type Loop = Expr +type WouldOvf = Expr + +[] +type RangeCount = + /// An expression representing a count known at compile time. + | Constant of Count + + /// An expression representing a "count" whose step is known to be zero at compile time. + /// Evaluating this expression at runtime will raise an exception. + | ConstantZeroStep of Expr + + /// An expression to compute a count at runtime that will definitely fit in 64 bits without overflow. + | Safe of Count + + /// A function for building a loop given an expression that may produce a count that + /// would not fit in 64 bits without overflow, and an expression indicating whether + /// evaluating the first expression directly would in fact overflow. + | PossiblyOversize of ((Count -> WouldOvf -> Expr) -> Expr) + +/// Makes an expression to compute the iteration count for the given integral range. +let mkRangeCount g m rangeTy rangeExpr start step finish = + /// This will raise an exception at runtime if step is zero. + let mkCallAndIgnoreRangeExpr start step finish = + // Use the potentially-evaluated-and-bound start, step, and finish. + let rangeExpr = + match rangeExpr with + // Type-specific range op (RangeInt32, etc.). + | Expr.App (funcExpr, formalType, tyargs, [_start; _step; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [start; step; finish], m) + // Generic range–step op (RangeStepGeneric). + | Expr.App (funcExpr, formalType, tyargs, [zero; add; _start; _step; _finish], m) -> Expr.App (funcExpr, formalType, tyargs, [zero; add; start; step; finish], m) + | _ -> error (InternalError ($"Unrecognized range function application '{rangeExpr}'.", m)) + + mkSequential + m + rangeExpr + (mkUnit g m) + + let mkSignednessAppropriateClt ty e1 e2 = + if isSignedIntegerTy g ty then + mkILAsmClt g m e1 e2 + else + mkAsmExpr ([AI_clt_un], [], [e1; e2], [g.bool_ty], m) + + let unsignedEquivalent ty = + if typeEquiv g ty g.int64_ty then g.uint64_ty + elif typeEquiv g ty g.int32_ty then g.uint32_ty + elif typeEquiv g ty g.int16_ty then g.uint16_ty + elif typeEquiv g ty g.sbyte_ty then g.byte_ty + else ty + + /// Find the unsigned type with twice the width of the given type, if available. + let nextWidestUnsignedTy ty = + let ty = stripMeasuresFromTy g ty + + if typeEquiv g ty g.int64_ty || typeEquiv g ty g.int32_ty || typeEquiv g ty g.uint32_ty then + g.uint64_ty + elif typeEquiv g ty g.int16_ty || typeEquiv g ty g.uint16_ty || typeEquiv g ty g.char_ty then + g.uint32_ty + elif typeEquiv g ty g.sbyte_ty || typeEquiv g ty g.byte_ty then + g.uint16_ty + else + ty + + /// Convert the value to the next-widest unsigned type. + /// We do this so that adding one won't result in overflow. + let mkWiden e = + let ty = stripMeasuresFromTy g rangeTy + + if typeEquiv g ty g.int32_ty then + mkAsmExpr ([AI_conv DT_I8], [], [e], [g.uint64_ty], m) + elif typeEquiv g ty g.uint32_ty then + mkAsmExpr ([AI_conv DT_U8], [], [e], [g.uint64_ty], m) + elif typeEquiv g ty g.int16_ty then + mkAsmExpr ([AI_conv DT_I4], [], [e], [g.uint32_ty], m) + elif typeEquiv g ty g.uint16_ty || typeEquiv g ty g.char_ty then + mkAsmExpr ([AI_conv DT_U4], [], [e], [g.uint32_ty], m) + elif typeEquiv g ty g.sbyte_ty then + mkAsmExpr ([AI_conv DT_I2], [], [e], [g.uint16_ty], m) + elif typeEquiv g ty g.byte_ty then + mkAsmExpr ([AI_conv DT_U2], [], [e], [g.uint16_ty], m) + else + e + + /// Expects that |e1| ≥ |e2|. + let mkDiff e1 e2 = mkAsmExpr ([AI_sub], [], [e1; e2], [unsignedEquivalent (tyOfExpr g e1)], m) + + /// diff / step + let mkQuotient diff step = mkAsmExpr ([AI_div_un], [], [diff; step], [tyOfExpr g diff], m) + + /// Whether the total count might not fit in 64 bits. + let couldBeTooBig ty = + let underlying = stripMeasuresFromTy g ty + + typeEquiv g underlying g.int64_ty + || typeEquiv g underlying g.uint64_ty + || typeEquiv g underlying g.nativeint_ty + || typeEquiv g underlying g.unativeint_ty + + /// pseudoCount + 1 + let mkAddOne pseudoCount = + let pseudoCount = mkWiden pseudoCount + let ty = tyOfExpr g pseudoCount + + if couldBeTooBig rangeTy then + mkAsmExpr ([AI_add_ovf_un], [], [pseudoCount; mkTypedOne g m ty], [ty], m) + else + mkAsmExpr ([AI_add], [], [pseudoCount; mkTypedOne g m ty], [ty], m) + + let mkRuntimeCalc mkThrowIfStepIsZero pseudoCount count = + let underlying = stripMeasuresFromTy g rangeTy + + if typeEquiv g underlying g.int64_ty || typeEquiv g underlying g.uint64_ty then + RangeCount.PossiblyOversize (fun mkLoopExpr -> + mkThrowIfStepIsZero + (mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> + let wouldOvf = mkILAsmCeq g m pseudoCount (Expr.Const (Const.UInt64 UInt64.MaxValue, m, g.uint64_ty)) + mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> + mkLoopExpr count wouldOvf)))) + elif typeEquiv g underlying g.nativeint_ty || typeEquiv g underlying g.unativeint_ty then // We have a nativeint ty whose size we won't know till runtime. + RangeCount.PossiblyOversize (fun mkLoopExpr -> + mkThrowIfStepIsZero + (mkCompGenLetIn m (nameof pseudoCount) (tyOfExpr g pseudoCount) pseudoCount (fun (_, pseudoCount) -> + let wouldOvf = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.bool_ty + (mkILAsmCeq g m (mkAsmExpr ([I_sizeof g.ilg.typ_IntPtr], [], [], [g.uint32_ty], m)) (Expr.Const (Const.UInt32 4u, m, g.uint32_ty))) + (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr (uint64 UInt32.MaxValue), m, g.unativeint_ty))) + (mkILAsmCeq g m pseudoCount (Expr.Const (Const.UIntPtr UInt64.MaxValue, m, g.unativeint_ty))) + + mkCompGenLetIn m (nameof wouldOvf) g.bool_ty wouldOvf (fun (_, wouldOvf) -> + mkLoopExpr count wouldOvf)))) + else + RangeCount.Safe (mkThrowIfStepIsZero count) + + match start, step, finish with + // start..0..finish + | _, Expr.Const (value = IntegralConst.Zero), _ -> RangeCount.ConstantZeroStep (mkSequential m (mkCallAndIgnoreRangeExpr start step finish) (mkTypedZero g m rangeTy)) + + // 5..1 + // 1..-1..5 + | EmptyRange -> RangeCount.Constant (mkTypedZero g m rangeTy) + + // 1..5 + // 1..2..5 + // 5..-1..1 + | ConstCount count -> RangeCount.Constant (Expr.Const (count, m, nextWidestUnsignedTy rangeTy)) + + // start..finish + // start..1..finish + // + // if finish < start then 0 else finish - start + 1 + | _, Expr.Const (value = IntegralConst.One), _ -> + let mkCount mkAddOne = + let count = mkAddOne (mkDiff finish start) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m countTy) + count + + match start, finish with + // The total count could exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 Int64.MinValue), _ | _, Expr.Const (value = Const.Int64 Int64.MaxValue) + | Expr.Const (value = Const.UInt64 UInt64.MinValue), _ | _, Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> + mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) + + // The total count could not exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) + | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> + RangeCount.Safe (mkCount mkAddOne) + + | _ -> mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) + + // (Only possible for signed types.) + // + // start..-1..finish + // + // if start < finish then 0 else start - finish + 1 + | _, Expr.Const (value = IntegralConst.MinusOne), _ -> + let mkCount mkAddOne = + let count = mkAddOne (mkDiff start finish) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkTypedZero g m countTy) + count + + match start, finish with + // The total count could exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 Int64.MaxValue), _ | _, Expr.Const (value = Const.Int64 Int64.MinValue) -> + mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) + + // The total count could not exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) -> + RangeCount.Safe (mkCount mkAddOne) + + | _ -> mkRuntimeCalc id (mkCount id) (mkCount mkAddOne) + + // start..2..finish + // + // if finish < start then 0 else (finish - start) / step + 1 + | _, Expr.Const (value = IntegralConst.Positive), _ -> + let count = + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m countTy) + count + + // We know that the magnitude of step is greater than one, + // so we know that the total count won't overflow. + RangeCount.Safe count + + // (Only possible for signed types.) + // + // start..-2..finish + // + // if start < finish then 0 else (start - finish) / abs step + 1 + | _, Expr.Const (value = IntegralConst.Negative as negativeStep), _ -> + let count = + let count = mkAddOne (mkQuotient (mkDiff start finish) (Expr.Const (IntegralConst.abs negativeStep, m, unsignedEquivalent rangeTy))) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkTypedZero g m countTy) + count + + // We know that the magnitude of step is greater than one, + // so we know that the total count won't overflow. + RangeCount.Safe count + + // start..step..finish + // + // if step = 0 then + // ignore ((.. ..) start step finish) // Throws. + // if 0 < step then + // if finish < start then 0 else unsigned (finish - start) / unsigned step + 1 + // else // step < 0 + // if start < finish then 0 else unsigned (start - finish) / unsigned (abs step) + 1 + | _, _, _ -> + // Let the range call throw the appropriate localized + // exception at runtime if step is zero: + // + // if step = 0 then ignore ((.. ..) start step finish) + let mkThrowIfStepIsZero count = + let throwIfStepIsZero = + mkCond + DebugPointAtBinding.NoneAtInvisible + m + g.unit_ty + (mkILAsmCeq g m step (mkTypedZero g m rangeTy)) + (mkCallAndIgnoreRangeExpr start step finish) + (mkUnit g m) + + mkSequential m throwIfStepIsZero count + + let mkCount mkAddOne = + if isSignedIntegerTy g rangeTy then + let positiveStep = + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m countTy) + count + + let negativeStep = + let absStep = mkAsmExpr ([AI_add], [], [mkAsmExpr ([AI_not], [], [step], [rangeTy], m); mkTypedOne g m rangeTy], [rangeTy], m) + let count = mkAddOne (mkQuotient (mkDiff start finish) absStep) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy start finish) + (mkTypedZero g m countTy) + count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + (tyOfExpr g positiveStep) + (mkSignednessAppropriateClt rangeTy (mkTypedZero g m rangeTy) step) + positiveStep + negativeStep + else // Unsigned. + let count = mkAddOne (mkQuotient (mkDiff finish start) step) + let countTy = tyOfExpr g count + + mkCond + DebugPointAtBinding.NoneAtInvisible + m + countTy + (mkSignednessAppropriateClt rangeTy finish start) + (mkTypedZero g m countTy) + count + + match start, finish with + // The total count could exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 Int64.MinValue), _ | _, Expr.Const (value = Const.Int64 Int64.MaxValue) + | Expr.Const (value = Const.Int64 Int64.MaxValue), _ | _, Expr.Const (value = Const.Int64 Int64.MinValue) + | Expr.Const (value = Const.UInt64 UInt64.MinValue), _ | _, Expr.Const (value = Const.UInt64 UInt64.MaxValue) -> + mkRuntimeCalc mkThrowIfStepIsZero (mkCount id) (mkCount mkAddOne) + + // The total count could not exceed 2⁶⁴. + | Expr.Const (value = Const.Int64 _), _ | _, Expr.Const (value = Const.Int64 _) + | Expr.Const (value = Const.UInt64 _), _ | _, Expr.Const (value = Const.UInt64 _) -> + RangeCount.Safe (mkThrowIfStepIsZero (mkCount mkAddOne)) + + | _ -> mkRuntimeCalc mkThrowIfStepIsZero (mkCount id) (mkCount mkAddOne) + +let mkOptimizedRangeLoop (g: TcGlobals) (mBody, mFor, mIn, spInWhile) (rangeTy, rangeExpr) (start, step, finish) (buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr)) = + let inline mkLetBindingsIfNeeded f = + match start, step, finish with + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + f start step finish + + | (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish) + + | _, (Expr.Const _ | Expr.Val _), (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + f start step finish) + + | (Expr.Const _ | Expr.Val _), _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> + f start step finish) + + | _, (Expr.Const _ | Expr.Val _), _ -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish)) + + | (Expr.Const _ | Expr.Val _), _, _ -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish)) + + | _, _, (Expr.Const _ | Expr.Val _) -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> + f start step finish)) + + | _, _, _ -> + mkCompGenLetIn start.Range (nameof start) rangeTy start (fun (_, start) -> + mkCompGenLetIn step.Range (nameof step) rangeTy step (fun (_, step) -> + mkCompGenLetIn finish.Range (nameof finish) rangeTy finish (fun (_, finish) -> + f start step finish))) + + mkLetBindingsIfNeeded (fun start step finish -> + /// Start at 0 and count up through count - 1. + /// + /// while i < count do + /// + /// i <- i + 1 + let mkCountUpExclusive mkBody count = + let countTy = tyOfExpr g count + + mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> + // loopVar <- loopVar + step + let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) + + // + // loopVar <- loopVar + step + // i <- i + 1 + let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI] + + // i < count + let guard = mkAsmExpr ([AI_clt_un], [], [idxVar; count], [g.bool_ty], mFor) + + // while i < count do + // + // loopVar <- loopVar + step + // i <- i + 1 + mkWhile + g + ( + spInWhile, + WhileLoopForCompiledForEachExprMarker, + guard, + body, + mBody + ) + ) + ) + + /// Start at 0 and count up till we have wrapped around. + /// We only emit this if the type is or may be 64-bit and step is not constant, + /// and we only execute it if step = 1 and |finish - step| = 2⁶⁴ + 1. + /// + /// Logically equivalent to (pseudo-code): + /// + /// while true do + /// + /// loopVar <- loopVar + step + /// i <- i + 1 + /// if i = 0 then break + let mkCountUpInclusive mkBody countTy = + mkCompGenLetMutableIn mFor "guard" g.bool_ty (mkTrue g mFor) (fun (guardVal, guardVar) -> + mkCompGenLetMutableIn mIn "i" countTy (mkTypedZero g mIn countTy) (fun (idxVal, idxVar) -> + mkCompGenLetMutableIn mIn "loopVar" rangeTy start (fun (loopVal, loopVar) -> + // loopVar <- loopVar + step + let incrV = mkValSet mIn (mkLocalValRef loopVal) (mkAsmExpr ([AI_add], [], [loopVar; step], [rangeTy], mIn)) + + // i <- i + 1 + let incrI = mkValSet mIn (mkLocalValRef idxVal) (mkAsmExpr ([AI_add], [], [idxVar; mkTypedOne g mIn countTy], [rangeTy], mIn)) + + // guard <- i <> 0 + let breakIfZero = mkValSet mFor (mkLocalValRef guardVal) (mkAsmExpr ([ILInstr.AI_cgt_un], [], [idxVar; mkTypedZero g mFor countTy], [g.bool_ty], mFor)) + + // + // loopVar <- loopVar + step + // i <- i + 1 + // guard <- i <> 0 + let body = mkSequentials g mBody [mkBody idxVar loopVar; incrV; incrI; breakIfZero] + + // while guard do + // + // loopVar <- loopVar + step + // i <- i + 1 + // guard <- i <> 0 + mkWhile + g + ( + spInWhile, + WhileLoopForCompiledForEachExprMarker, + guardVar, + body, + mBody + ) + ) + ) + ) + + match mkRangeCount g mIn rangeTy rangeExpr start step finish with + | RangeCount.Constant count -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count) + + | RangeCount.ConstantZeroStep count -> + mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count)) + + | RangeCount.Safe count -> + mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> + buildLoop count (fun mkBody -> mkCountUpExclusive mkBody count)) + + | RangeCount.PossiblyOversize calc -> + calc (fun count wouldOvf -> + buildLoop count (fun mkBody -> + mkCond + DebugPointAtBinding.NoneAtInvisible + mIn + g.unit_ty + wouldOvf + (mkCountUpInclusive mkBody (tyOfExpr g count)) + (mkCompGenLetIn mIn (nameof count) (tyOfExpr g count) count (fun (_, count) -> mkCountUpExclusive mkBody count)))) + ) let mkDebugPoint m expr = Expr.DebugPoint(DebugPointAtLeafExpr.Yes m, expr) @@ -10132,6 +10890,18 @@ let DetectAndOptimizeForEachExpression g option expr = let spFor = match spFor with DebugPointAtBinding.Yes mFor -> DebugPointAtFor.Yes mFor | _ -> DebugPointAtFor.No mkFastForLoop g (spFor, spIn, mWholeExpr, elemVar, startExpr, (step = 1), finishExpr, bodyExpr) + | OptimizeAllForExpressions, CompiledForEachExpr g (_enumTy, rangeExpr & IntegralRange g (rangeTy, (start, step, finish)), elemVar, bodyExpr, ranges) when + g.langVersion.SupportsFeature LanguageFeature.LowerIntegralRangesToFastLoops + -> + let mBody, _spFor, _spIn, mFor, mIn, spInWhile, _mWhole = ranges + + mkOptimizedRangeLoop + g + (mBody, mFor, mIn, spInWhile) + (rangeTy, rangeExpr) + (start, step, finish) + (fun _count mkLoop -> mkLoop (fun _idxVar loopVar -> mkInvisibleLet elemVar.Range elemVar loopVar bodyExpr)) + | OptimizeAllForExpressions, CompiledForEachExpr g (enumerableTy, enumerableExpr, elemVar, bodyExpr, ranges) -> let mBody, spFor, spIn, mFor, mIn, spInWhile, mWholeExpr = ranges @@ -10225,12 +10995,6 @@ let mkUnitDelayLambda (g: TcGlobals) m e = let uv, _ = mkCompGenLocal m "unitVar" g.unit_ty mkLambda m uv (e, tyOfExpr g e) - -let (|ValApp|_|) g vref expr = - match expr with - | Expr.App (Expr.Val (vref2, _, _), _f0ty, tyargs, args, m) when valRefEq g vref vref2 -> Some (tyargs, args, m) - | _ -> None - let (|UseResumableStateMachinesExpr|_|) g expr = match expr with | ValApp g g.cgh__useResumableCode_vref (_, _, _m) -> Some () diff --git a/src/Compiler/TypedTree/TypedTreeOps.fsi b/src/Compiler/TypedTree/TypedTreeOps.fsi index 534eefc7762..1154b7e8a01 100755 --- a/src/Compiler/TypedTree/TypedTreeOps.fsi +++ b/src/Compiler/TypedTree/TypedTreeOps.fsi @@ -218,6 +218,10 @@ val mkCompGenLet: range -> Val -> Expr -> Expr -> Expr /// is returned by the given continuation. Compiler-generated bindings do not give rise to a sequence point in debugging. val mkCompGenLetIn: range -> string -> TType -> Expr -> (Val * Expr -> Expr) -> Expr +/// Make a mutable let-expression that locally binds a compiler-generated value to an expression, where the expression +/// is returned by the given continuation. Compiler-generated bindings do not give rise to a sequence point in debugging. +val mkCompGenLetMutableIn: range -> string -> TType -> Expr -> (Val * Expr -> Expr) -> Expr + /// Make a let-expression that locally binds a value to an expression in an "invisible" way. /// Invisible bindings are not given a sequence point and should not have side effects. val mkInvisibleLet: range -> Val -> Expr -> Expr -> Expr @@ -1960,6 +1964,12 @@ val mkTwo: TcGlobals -> range -> Expr val mkMinusOne: TcGlobals -> range -> Expr +/// Makes an expression holding a constant 0 value of the given numeric type. +val mkTypedZero: g: TcGlobals -> m: range -> ty: TType -> Expr + +/// Makes an expression holding a constant 1 value of the given numeric type. +val mkTypedOne: g: TcGlobals -> m: range -> ty: TType -> Expr + val destInt32: Expr -> int32 option //------------------------------------------------------------------------- @@ -2546,6 +2556,50 @@ val (|SpecialEquatableHeadType|_|): TcGlobals -> TType -> TType list option val (|SpecialNotEquatableHeadType|_|): TcGlobals -> TType -> unit option +/// Matches if the given expression is an application +/// of the range or range-step operator on an integral type +/// and returns the type, start, step, and finish if so. +/// +/// start..finish +/// +/// start..step..finish +[] +val (|IntegralRange|_|): g: TcGlobals -> expr: Expr -> (TType * (Expr * Expr * Expr)) voption + +[] +module IntegralConst = + /// Constant 0. + [] + val (|Zero|_|): c: Const -> unit voption + +/// An expression holding the loop's iteration count. +type Count = Expr + +/// An expression representing the loop's current iteration index. +type Idx = Expr + +/// An expression representing the current loop element. +type Elem = Expr + +/// An expression representing the loop body. +type Body = Expr + +/// An expression representing the overall loop. +type Loop = Expr + +/// Makes an optimized while-loop for a range expression with the given integral start, step, and finish: +/// +/// start..step..finish +/// +/// The buildLoop function enables using the precomputed iteration count in an optional initialization step before the loop is executed. +val mkOptimizedRangeLoop: + g: TcGlobals -> + mBody: range * mFor: range * mIn: range * spInWhile: DebugPointAtWhile -> + rangeTy: TType * rangeExpr: Expr -> + start: Expr * step: Expr * finish: Expr -> + buildLoop: (Count -> ((Idx -> Elem -> Body) -> Loop) -> Expr) -> + Expr + type OptimizeForExpressionOptions = | OptimizeIntRangesOnly | OptimizeAllForExpressions diff --git a/src/Compiler/xlf/FSComp.txt.cs.xlf b/src/Compiler/xlf/FSComp.txt.cs.xlf index c46e652979d..66205091123 100644 --- a/src/Compiler/xlf/FSComp.txt.cs.xlf +++ b/src/Compiler/xlf/FSComp.txt.cs.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Povolit duplikát malými písmeny při atributu RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.de.xlf b/src/Compiler/xlf/FSComp.txt.de.xlf index 56f7493d1d1..f72b6948a76 100644 --- a/src/Compiler/xlf/FSComp.txt.de.xlf +++ b/src/Compiler/xlf/FSComp.txt.de.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute DU in Kleinbuchstaben zulassen, wenn requireQualifiedAccess-Attribut diff --git a/src/Compiler/xlf/FSComp.txt.es.xlf b/src/Compiler/xlf/FSComp.txt.es.xlf index a35a6bce598..12f4457f73e 100644 --- a/src/Compiler/xlf/FSComp.txt.es.xlf +++ b/src/Compiler/xlf/FSComp.txt.es.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Permitir DU en minúsculas con el atributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.fr.xlf b/src/Compiler/xlf/FSComp.txt.fr.xlf index aeeb53ac93d..9477b8b7680 100644 --- a/src/Compiler/xlf/FSComp.txt.fr.xlf +++ b/src/Compiler/xlf/FSComp.txt.fr.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Autoriser les DU en minuscules pour l'attribut RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.it.xlf b/src/Compiler/xlf/FSComp.txt.it.xlf index 390160ee95e..b17ab37848d 100644 --- a/src/Compiler/xlf/FSComp.txt.it.xlf +++ b/src/Compiler/xlf/FSComp.txt.it.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Consentire l’unione discriminata minuscola quando l'attributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.ja.xlf b/src/Compiler/xlf/FSComp.txt.ja.xlf index e57dac6f312..fa6fb18bda6 100644 --- a/src/Compiler/xlf/FSComp.txt.ja.xlf +++ b/src/Compiler/xlf/FSComp.txt.ja.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess 属性の場合に小文字 DU を許可する diff --git a/src/Compiler/xlf/FSComp.txt.ko.xlf b/src/Compiler/xlf/FSComp.txt.ko.xlf index 2d6a4e5e22b..1cf38ecd52e 100644 --- a/src/Compiler/xlf/FSComp.txt.ko.xlf +++ b/src/Compiler/xlf/FSComp.txt.ko.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess 특성이 있는 경우 소문자 DU 허용 diff --git a/src/Compiler/xlf/FSComp.txt.pl.xlf b/src/Compiler/xlf/FSComp.txt.pl.xlf index db56cd3ba49..a36f1d7cb51 100644 --- a/src/Compiler/xlf/FSComp.txt.pl.xlf +++ b/src/Compiler/xlf/FSComp.txt.pl.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Zezwalaj na małą literę DU, gdy występuje RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf index 7566fb49ae1..129e7cb792e 100644 --- a/src/Compiler/xlf/FSComp.txt.pt-BR.xlf +++ b/src/Compiler/xlf/FSComp.txt.pt-BR.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Permitir DU em minúsculas quando o atributo RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.ru.xlf b/src/Compiler/xlf/FSComp.txt.ru.xlf index 90c39f565ee..d0acf9ef585 100644 --- a/src/Compiler/xlf/FSComp.txt.ru.xlf +++ b/src/Compiler/xlf/FSComp.txt.ru.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute Разрешить du в нижнем регистре, если атрибут RequireQualifiedAccess diff --git a/src/Compiler/xlf/FSComp.txt.tr.xlf b/src/Compiler/xlf/FSComp.txt.tr.xlf index 496bc35ef95..555f737153e 100644 --- a/src/Compiler/xlf/FSComp.txt.tr.xlf +++ b/src/Compiler/xlf/FSComp.txt.tr.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess özniteliğinde küçük harf DU'ya izin ver diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf index 94bd2ea062c..72e2ea8f447 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hans.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute 当 RequireQualifiedAccess 属性时允许小写 DU diff --git a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf index 9334199ba0f..817e803623b 100644 --- a/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf +++ b/src/Compiler/xlf/FSComp.txt.zh-Hant.xlf @@ -387,6 +387,11 @@ Optimizes interpolated strings in certain cases, by lowering to concatenation + + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + Optimizes certain uses of the integral range (..) and range-step (.. ..) operators to fast while-loops. + + Allow lowercase DU when RequireQualifiedAccess attribute RequireQualifiedAccess 屬性時允許小寫 DU diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.RealInternalSignatureOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.RealInternalSignatureOff.il.bsl index ddc2e25a3e9..1af6d7ef89d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.RealInternalSignatureOff.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpr07.fs.RealInternalSignatureOff.il.bsl @@ -166,7 +166,10 @@ { .maxstack 9 - .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0) + .locals init (class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) IL_0000: ldc.i4.1 IL_0001: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1::.ctor(!0) IL_0006: stloc.0 @@ -175,32 +178,52 @@ IL_000d: ldarg.0 IL_000e: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ IL_0013: ldc.i4.0 - IL_0014: ldc.i4.1 - IL_0015: ldc.i4.3 - IL_0016: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_001b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0020: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0025: ldarg.0 - IL_0026: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_002b: ldloc.0 - IL_002c: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldc.i4.0 + IL_0017: stloc.3 + IL_0018: ldloc.2 + IL_0019: ldc.i4.4 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0032 + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: nop + IL_0030: br.s IL_0018 + + IL_0032: ldloca.s V_1 + IL_0034: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0039: ldarg.0 + IL_003a: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_003f: ldloc.0 + IL_0040: newobj instance void Program/'res7@10-1'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0031: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, + IL_0045: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::For(class [runtime]System.Collections.Generic.IEnumerable`1, class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_0036: ldarg.0 - IL_0037: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_003c: ldarg.0 - IL_003d: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ - IL_0042: ldloc.0 - IL_0043: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, + IL_004a: ldarg.0 + IL_004b: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_0050: ldarg.0 + IL_0051: ldfld class [ComputationExprLibrary]Library.EventuallyBuilder Program/res7@9::builder@ + IL_0056: ldloc.0 + IL_0057: newobj instance void Program/'res7@12-2'::.ctor(class [ComputationExprLibrary]Library.EventuallyBuilder, class [FSharp.Core]Microsoft.FSharp.Core.FSharpRef`1) - IL_0048: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) - IL_004d: tail. - IL_004f: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, + IL_005c: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Delay(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2>) + IL_0061: tail. + IL_0063: callvirt instance class [ComputationExprLibrary]Library.Eventually`1 [ComputationExprLibrary]Library.EventuallyBuilder::Combine(class [ComputationExprLibrary]Library.Eventually`1, class [ComputationExprLibrary]Library.Eventually`1) - IL_0054: ret + IL_0068: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs index b1e8ca4f4c8..14a4a7e4270 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputationExpressions/ComputationExpressions.fs @@ -114,4 +114,5 @@ module ComputationExpressions = let ``ComputationExpr07_realsig=false`` compilation = compilation |> withoutRealInternalSignature + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs new file mode 100644 index 00000000000..b97d6e164fb --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/ComputedCollections.fs @@ -0,0 +1,36 @@ +namespace EmittedIL + +open FSharp.Test +open FSharp.Test.Compiler +open Xunit + +module ComputedCollections = + let verifyCompilation compilation = + compilation + |> asExe + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> withOptimize + |> withEmbeddedPdb + |> withEmbedAllSource + |> ignoreWarnings + |> verifyILBaseline + + [] + let ``Int32RangeArrays_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``Int32RangeLists_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``UInt64RangeArrays_fs`` compilation = + compilation + |> verifyCompilation + + [] + let ``UInt64RangeLists_fs`` compilation = + compilation + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs new file mode 100644 index 00000000000..6d51226e87d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs @@ -0,0 +1,25 @@ +let f1 () = [|1..10|] +let f2 () = [|10..1|] +let f3 () = [|1..1..10|] +let f4 () = [|1..2..10|] +let f5 () = [|10..1..1|] +let f6 () = [|1..-1..10|] +let f7 () = [|10..-1..1|] +let f8 () = [|10..-2..1|] +let f9 start = [|start..10|] +let f10 finish = [|1..finish|] +let f11 start finish = [|start..finish|] +let f12 start = [|start..1..10|] +let f13 step = [|1..step..10|] +let f14 finish = [|1..1..finish|] +let f15 start step = [|start..step..10|] +let f16 start finish = [|start..1..finish|] +let f17 step finish = [|1..step..finish|] +let f18 start step finish = [|start..step..finish|] +let f19 f = [|f ()..10|] +let f20 f = [|1..f ()|] +let f21 f g = [|f ()..g()|] +let f22 f = [|f ()..1..10|] +let f23 f = [|1..f ()..10|] +let f24 f = [|1..1..f ()|] +let f25 f g h = [|f ()..g ()..h ()|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl new file mode 100644 index 00000000000..36ec223fd78 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeArrays.fs.il.bsl @@ -0,0 +1,1831 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .method public static int32[] f1() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i4 + IL_0016: ldloc.2 + IL_0017: ldc.i4.1 + IL_0018: add + IL_0019: stloc.2 + IL_001a: ldloc.1 + IL_001b: ldc.i4.1 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static int32[] f2() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static int32[] f3() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i4 + IL_0016: ldloc.2 + IL_0017: ldc.i4.1 + IL_0018: add + IL_0019: stloc.2 + IL_001a: ldloc.1 + IL_001b: ldc.i4.1 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static int32[] f4() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.5 + IL_0001: conv.i8 + IL_0002: conv.ovf.i.un + IL_0003: newarr [runtime]System.Int32 + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.1 + IL_000d: stloc.2 + IL_000e: br.s IL_001e + + IL_0010: ldloc.0 + IL_0011: ldloc.1 + IL_0012: conv.i + IL_0013: ldloc.2 + IL_0014: stelem.i4 + IL_0015: ldloc.2 + IL_0016: ldc.i4.2 + IL_0017: add + IL_0018: stloc.2 + IL_0019: ldloc.1 + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: add + IL_001d: stloc.1 + IL_001e: ldloc.1 + IL_001f: ldc.i4.5 + IL_0020: conv.i8 + IL_0021: blt.un.s IL_0010 + + IL_0023: ldloc.0 + IL_0024: ret + } + + .method public static int32[] f5() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static int32[] f6() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static int32[] f7() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.Int32 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.s 10 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stelem.i4 + IL_0017: ldloc.2 + IL_0018: ldc.i4.m1 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldc.i4.s 10 + IL_0023: conv.i8 + IL_0024: blt.un.s IL_0012 + + IL_0026: ldloc.0 + IL_0027: ret + } + + .method public static int32[] f8() cil managed + { + + .maxstack 5 + .locals init (int32[] V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.5 + IL_0001: conv.i8 + IL_0002: conv.ovf.i.un + IL_0003: newarr [runtime]System.Int32 + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.s 10 + IL_000e: stloc.2 + IL_000f: br.s IL_0020 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i4 + IL_0016: ldloc.2 + IL_0017: ldc.i4.s -2 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldc.i4.5 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static int32[] f9(int32 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldc.i4.s 10 + 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: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: ldloc.1 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: bge.un.s IL_0022 + + IL_001c: call !!0[] [runtime]System.Array::Empty() + IL_0021: ret + + IL_0022: ldloc.1 + IL_0023: conv.ovf.i.un + IL_0024: newarr [runtime]System.Int32 + IL_0029: stloc.2 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: ldarg.0 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0043 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i4 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.s V_4 + IL_003e: ldloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0032 + + IL_0047: ldloc.2 + IL_0048: ret + } + + .method public static int32[] f10(int32 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + 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: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldc.i4.1 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret + } + + .method public static int32[] f11(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 (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + 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.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldarg.0 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret + } + + .method public static int32[] f12(int32 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldc.i4.s 10 + 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: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + IL_0015: ldloc.0 + IL_0016: stloc.1 + IL_0017: ldloc.1 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: bge.un.s IL_0022 + + IL_001c: call !!0[] [runtime]System.Array::Empty() + IL_0021: ret + + IL_0022: ldloc.1 + IL_0023: conv.ovf.i.un + IL_0024: newarr [runtime]System.Int32 + IL_0029: stloc.2 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: ldarg.0 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0043 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i4 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.s V_4 + IL_003e: ldloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.3 + IL_0043: ldloc.3 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0032 + + IL_0047: ldloc.2 + IL_0048: ret + } + + .method public static int32[] f13(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.0 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldc.i4.1 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldc.i4.1 + IL_0023: sub + IL_0024: ldarg.0 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldc.i4.1 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldc.i4.1 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.0 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldloc.0 + IL_0047: stloc.1 + IL_0048: ldloc.1 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: bge.un.s IL_0053 + + IL_004d: call !!0[] [runtime]System.Array::Empty() + IL_0052: ret + + IL_0053: ldloc.1 + IL_0054: conv.ovf.i.un + IL_0055: newarr [runtime]System.Int32 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: conv.i8 + IL_005d: stloc.3 + IL_005e: ldc.i4.1 + IL_005f: stloc.s V_4 + IL_0061: br.s IL_0074 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stelem.i4 + IL_0069: ldloc.s V_4 + IL_006b: ldarg.0 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0063 + + IL_0078: ldloc.2 + IL_0079: ret + } + + .method public static int32[] f14(int32 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + 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: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldc.i4.1 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret + } + + .method public static int32[] f15(int32 start, + int32 step) 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 (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.1 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldarg.0 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldarg.0 + IL_0023: sub + IL_0024: ldarg.1 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldarg.0 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldarg.0 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldloc.0 + IL_0047: stloc.1 + IL_0048: ldloc.1 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: bge.un.s IL_0053 + + IL_004d: call !!0[] [runtime]System.Array::Empty() + IL_0052: ret + + IL_0053: ldloc.1 + IL_0054: conv.ovf.i.un + IL_0055: newarr [runtime]System.Int32 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: conv.i8 + IL_005d: stloc.3 + IL_005e: ldarg.0 + IL_005f: stloc.s V_4 + IL_0061: br.s IL_0074 + + IL_0063: ldloc.2 + IL_0064: ldloc.3 + IL_0065: conv.i + IL_0066: ldloc.s V_4 + IL_0068: stelem.i4 + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldloc.0 + IL_0076: blt.un.s IL_0063 + + IL_0078: ldloc.2 + IL_0079: ret + } + + .method public static int32[] f16(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 (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + 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.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldloc.0 + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: bge.un.s IL_0020 + + IL_001a: call !!0[] [runtime]System.Array::Empty() + IL_001f: ret + + IL_0020: ldloc.1 + IL_0021: conv.ovf.i.un + IL_0022: newarr [runtime]System.Int32 + IL_0027: stloc.2 + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: stloc.3 + IL_002b: ldarg.0 + IL_002c: stloc.s V_4 + IL_002e: br.s IL_0041 + + IL_0030: ldloc.2 + IL_0031: ldloc.3 + IL_0032: conv.i + IL_0033: ldloc.s V_4 + IL_0035: stelem.i4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: stloc.s V_4 + IL_003c: ldloc.3 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.3 + IL_0041: ldloc.3 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_0030 + + IL_0045: ldloc.2 + IL_0046: ret + } + + .method public static int32[] f17(int32 step, + 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 (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldarg.1 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.1 + IL_0016: ldc.i4.1 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.1 + IL_001f: ldc.i4.1 + IL_0020: sub + IL_0021: ldarg.0 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldc.i4.1 + IL_002b: ldarg.1 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldc.i4.1 + IL_0034: ldarg.1 + IL_0035: sub + IL_0036: ldarg.0 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr [runtime]System.Int32 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldc.i4.1 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_006f + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stelem.i4 + IL_0064: ldloc.s V_4 + IL_0066: ldarg.0 + IL_0067: add + IL_0068: stloc.s V_4 + IL_006a: ldloc.3 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.3 + IL_006f: ldloc.3 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_005e + + IL_0073: ldloc.2 + IL_0074: ret + } + + .method public static int32[] f18(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32[] V_2, + uint64 V_3, + int32 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldloc.0 + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: bge.un.s IL_004e + + IL_0048: call !!0[] [runtime]System.Array::Empty() + IL_004d: ret + + IL_004e: ldloc.1 + IL_004f: conv.ovf.i.un + IL_0050: newarr [runtime]System.Int32 + IL_0055: stloc.2 + IL_0056: ldc.i4.0 + IL_0057: conv.i8 + IL_0058: stloc.3 + IL_0059: ldarg.0 + IL_005a: stloc.s V_4 + IL_005c: br.s IL_006f + + IL_005e: ldloc.2 + IL_005f: ldloc.3 + IL_0060: conv.i + IL_0061: ldloc.s V_4 + IL_0063: stelem.i4 + IL_0064: ldloc.s V_4 + IL_0066: ldarg.1 + IL_0067: add + IL_0068: stloc.s V_4 + IL_006a: ldloc.3 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.3 + IL_006f: ldloc.3 + IL_0070: ldloc.0 + IL_0071: blt.un.s IL_005e + + IL_0073: ldloc.2 + IL_0074: ret + } + + .method public static int32[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldloc.1 + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: bge.un.s IL_0029 + + IL_0023: call !!0[] [runtime]System.Array::Empty() + IL_0028: ret + + IL_0029: ldloc.2 + IL_002a: conv.ovf.i.un + IL_002b: newarr [runtime]System.Int32 + IL_0030: stloc.3 + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: ldloc.0 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_004e + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i4 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: add + IL_0045: stloc.s V_5 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.1 + IL_0051: blt.un.s IL_003a + + IL_0053: ldloc.3 + IL_0054: ret + } + + .method public static int32[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: stloc.2 + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: bge.un.s IL_0027 + + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret + + IL_0027: ldloc.2 + IL_0028: conv.ovf.i.un + IL_0029: newarr [runtime]System.Int32 + IL_002e: stloc.3 + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: stloc.s V_5 + IL_0036: br.s IL_004c + + IL_0038: ldloc.3 + IL_0039: ldloc.s V_4 + IL_003b: conv.i + IL_003c: ldloc.s V_5 + IL_003e: stelem.i4 + IL_003f: ldloc.s V_5 + IL_0041: ldc.i4.1 + IL_0042: add + IL_0043: stloc.s V_5 + IL_0045: ldloc.s V_4 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: ldloc.1 + IL_004f: blt.un.s IL_0038 + + IL_0051: ldloc.3 + IL_0052: ret + } + + .method public static int32[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) 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, + uint64 V_2, + uint64 V_3, + int32[] V_4, + uint64 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldloc.0 + IL_0012: bge.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0021 + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: conv.i8 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: nop + IL_0021: stloc.2 + IL_0022: ldloc.2 + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: bge.un.s IL_002f + + IL_0029: call !!0[] [runtime]System.Array::Empty() + IL_002e: ret + + IL_002f: ldloc.3 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.s V_4 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.s V_5 + IL_003c: ldloc.0 + IL_003d: stloc.s V_6 + IL_003f: br.s IL_0056 + + IL_0041: ldloc.s V_4 + IL_0043: ldloc.s V_5 + IL_0045: conv.i + IL_0046: ldloc.s V_6 + IL_0048: stelem.i4 + IL_0049: ldloc.s V_6 + IL_004b: ldc.i4.1 + IL_004c: add + IL_004d: stloc.s V_6 + IL_004f: ldloc.s V_5 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.s V_5 + IL_0056: ldloc.s V_5 + IL_0058: ldloc.2 + IL_0059: blt.un.s IL_0041 + + IL_005b: ldloc.s V_4 + IL_005d: ret + } + + .method public static int32[] f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldloc.1 + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: bge.un.s IL_0029 + + IL_0023: call !!0[] [runtime]System.Array::Empty() + IL_0028: ret + + IL_0029: ldloc.2 + IL_002a: conv.ovf.i.un + IL_002b: newarr [runtime]System.Int32 + IL_0030: stloc.3 + IL_0031: ldc.i4.0 + IL_0032: conv.i8 + IL_0033: stloc.s V_4 + IL_0035: ldloc.0 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_004e + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i4 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: add + IL_0045: stloc.s V_5 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: conv.i8 + IL_004b: add + IL_004c: stloc.s V_4 + IL_004e: ldloc.s V_4 + IL_0050: ldloc.1 + IL_0051: blt.un.s IL_003a + + IL_0053: ldloc.3 + IL_0054: ret + } + + .method public static int32[] f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_0018 + + IL_000b: ldc.i4.1 + IL_000c: ldloc.0 + IL_000d: ldc.i4.s 10 + IL_000f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.0 + IL_001a: ldloc.0 + IL_001b: bge.s IL_0034 + + IL_001d: ldc.i4.s 10 + IL_001f: ldc.i4.1 + IL_0020: bge.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_004c + + IL_0027: ldc.i4.s 10 + IL_0029: ldc.i4.1 + IL_002a: sub + IL_002b: ldloc.0 + IL_002c: div.un + IL_002d: conv.i8 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: nop + IL_0032: br.s IL_004c + + IL_0034: ldc.i4.1 + IL_0035: ldc.i4.s 10 + IL_0037: bge.s IL_003e + + IL_0039: ldc.i4.0 + IL_003a: conv.i8 + IL_003b: nop + IL_003c: br.s IL_004c + + IL_003e: ldc.i4.1 + IL_003f: ldc.i4.s 10 + IL_0041: sub + IL_0042: ldloc.0 + IL_0043: not + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: div.un + IL_0047: conv.i8 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: nop + IL_004c: stloc.1 + IL_004d: ldloc.1 + IL_004e: stloc.2 + IL_004f: ldloc.2 + IL_0050: ldc.i4.1 + IL_0051: conv.i8 + IL_0052: bge.un.s IL_005a + + IL_0054: call !!0[] [runtime]System.Array::Empty() + IL_0059: ret + + IL_005a: ldloc.2 + IL_005b: conv.ovf.i.un + IL_005c: newarr [runtime]System.Int32 + IL_0061: stloc.3 + IL_0062: ldc.i4.0 + IL_0063: conv.i8 + IL_0064: stloc.s V_4 + IL_0066: ldc.i4.1 + IL_0067: stloc.s V_5 + IL_0069: br.s IL_007f + + IL_006b: ldloc.3 + IL_006c: ldloc.s V_4 + IL_006e: conv.i + IL_006f: ldloc.s V_5 + IL_0071: stelem.i4 + IL_0072: ldloc.s V_5 + IL_0074: ldloc.0 + IL_0075: add + IL_0076: stloc.s V_5 + IL_0078: ldloc.s V_4 + IL_007a: ldc.i4.1 + IL_007b: conv.i8 + IL_007c: add + IL_007d: stloc.s V_4 + IL_007f: ldloc.s V_4 + IL_0081: ldloc.1 + IL_0082: blt.un.s IL_006b + + IL_0084: ldloc.3 + IL_0085: ret + } + + .method public static int32[] f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + uint64 V_2, + int32[] V_3, + uint64 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: stloc.2 + IL_001c: ldloc.2 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: bge.un.s IL_0027 + + IL_0021: call !!0[] [runtime]System.Array::Empty() + IL_0026: ret + + IL_0027: ldloc.2 + IL_0028: conv.ovf.i.un + IL_0029: newarr [runtime]System.Int32 + IL_002e: stloc.3 + IL_002f: ldc.i4.0 + IL_0030: conv.i8 + IL_0031: stloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: stloc.s V_5 + IL_0036: br.s IL_004c + + IL_0038: ldloc.3 + IL_0039: ldloc.s V_4 + IL_003b: conv.i + IL_003c: ldloc.s V_5 + IL_003e: stelem.i4 + IL_003f: ldloc.s V_5 + IL_0041: ldc.i4.1 + IL_0042: add + IL_0043: stloc.s V_5 + IL_0045: ldloc.s V_4 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: ldloc.1 + IL_004f: blt.un.s IL_0038 + + IL_0051: ldloc.3 + IL_0052: ret + } + + .method public static int32[] f25(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 h) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + uint64 V_3, + uint64 V_4, + int32[] V_5, + uint64 V_6, + int32 V_7) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldarg.2 + IL_0011: ldnull + IL_0012: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: brtrue.s IL_0027 + + IL_001b: ldloc.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::RangeInt32(int32, + int32, + int32) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldc.i4.0 + IL_0029: ldloc.1 + IL_002a: bge.s IL_0041 + + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0057 + + IL_0035: ldloc.2 + IL_0036: ldloc.0 + IL_0037: sub + IL_0038: ldloc.1 + IL_0039: div.un + IL_003a: conv.i8 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: nop + IL_003f: br.s IL_0057 + + IL_0041: ldloc.0 + IL_0042: ldloc.2 + IL_0043: bge.s IL_004a + + IL_0045: ldc.i4.0 + IL_0046: conv.i8 + IL_0047: nop + IL_0048: br.s IL_0057 + + IL_004a: ldloc.0 + IL_004b: ldloc.2 + IL_004c: sub + IL_004d: ldloc.1 + IL_004e: not + IL_004f: ldc.i4.1 + IL_0050: add + IL_0051: div.un + IL_0052: conv.i8 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: nop + IL_0057: stloc.3 + IL_0058: ldloc.3 + IL_0059: stloc.s V_4 + IL_005b: ldloc.s V_4 + IL_005d: ldc.i4.1 + IL_005e: conv.i8 + IL_005f: bge.un.s IL_0067 + + IL_0061: call !!0[] [runtime]System.Array::Empty() + IL_0066: ret + + IL_0067: ldloc.s V_4 + IL_0069: conv.ovf.i.un + IL_006a: newarr [runtime]System.Int32 + IL_006f: stloc.s V_5 + IL_0071: ldc.i4.0 + IL_0072: conv.i8 + IL_0073: stloc.s V_6 + IL_0075: ldloc.0 + IL_0076: stloc.s V_7 + IL_0078: br.s IL_008f + + IL_007a: ldloc.s V_5 + IL_007c: ldloc.s V_6 + IL_007e: conv.i + IL_007f: ldloc.s V_7 + IL_0081: stelem.i4 + IL_0082: ldloc.s V_7 + IL_0084: ldloc.1 + IL_0085: add + IL_0086: stloc.s V_7 + IL_0088: ldloc.s V_6 + IL_008a: ldc.i4.1 + IL_008b: conv.i8 + IL_008c: add + IL_008d: stloc.s V_6 + IL_008f: ldloc.s V_6 + IL_0091: ldloc.3 + IL_0092: blt.un.s IL_007a + + IL_0094: ldloc.s V_5 + IL_0096: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs new file mode 100644 index 00000000000..8e67d795f65 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs @@ -0,0 +1,25 @@ +let f1 () = [1..10] +let f2 () = [10..1] +let f3 () = [1..1..10] +let f4 () = [1..2..10] +let f5 () = [10..1..1] +let f6 () = [1..-1..10] +let f7 () = [10..-1..1] +let f8 () = [10..-2..1] +let f9 start = [start..10] +let f10 finish = [1..finish] +let f11 start finish = [start..finish] +let f12 start = [start..1..10] +let f13 step = [1..step..10] +let f14 finish = [1..1..finish] +let f15 start step = [start..step..10] +let f16 start finish = [start..1..finish] +let f17 step finish = [1..step..finish] +let f18 start step finish = [start..step..finish] +let f19 f = [f ()..10] +let f20 f = [1..f ()] +let f21 f g = [f ()..g()] +let f22 f = [f ()..1..10] +let f23 f = [1..f ()..10] +let f24 f = [1..1..f ()] +let f25 f g h = [f ()..g ()..h ()] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl new file mode 100644 index 00000000000..104102225b1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/Int32RangeLists.fs.il.bsl @@ -0,0 +1,1558 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f1() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0007 + + IL_001f: ldloca.s V_0 + IL_0021: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0026: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f2() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f3() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0007 + + IL_001f: ldloca.s V_0 + IL_0021: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0026: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f4() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.2 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.5 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0007 + + IL_001e: ldloca.s V_0 + IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0025: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f5() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f6() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f7() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.2 + IL_0006: br.s IL_001a + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.m1 + IL_0013: add + IL_0014: stloc.2 + IL_0015: ldloc.1 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.1 + IL_001a: ldloc.1 + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: blt.un.s IL_0008 + + IL_0020: ldloca.s V_0 + IL_0022: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0027: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f8() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.s -2 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.5 + IL_001d: conv.i8 + IL_001e: blt.un.s IL_0008 + + IL_0020: ldloca.s V_0 + IL_0022: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0027: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f9(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + 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: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + 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_002e + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.3 + IL_0029: ldloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.2 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001c + + IL_0032: ldloca.s V_1 + IL_0034: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0039: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f10(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + 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: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldc.i4.1 + IL_0017: stloc.3 + IL_0018: br.s IL_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + 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: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f11(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 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + 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.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldarg.0 + IL_0017: stloc.3 + IL_0018: br.s IL_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + 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: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f12(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + 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: ldarg.0 + IL_000e: sub + IL_000f: conv.i8 + IL_0010: ldc.i4.1 + IL_0011: conv.i8 + IL_0012: add + IL_0013: nop + IL_0014: stloc.0 + 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_002e + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.3 + IL_0029: ldloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.2 + IL_002f: ldloc.0 + IL_0030: blt.un.s IL_001c + + IL_0032: ldloca.s V_1 + IL_0034: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0039: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f13(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.0 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldc.i4.1 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldc.i4.1 + IL_0023: sub + IL_0024: ldarg.0 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldc.i4.1 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldc.i4.1 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.0 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.2 + IL_0049: ldc.i4.1 + IL_004a: stloc.3 + IL_004b: br.s IL_005f + + IL_004d: ldloca.s V_1 + IL_004f: ldloc.3 + IL_0050: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0055: nop + IL_0056: ldloc.3 + IL_0057: ldarg.0 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.2 + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.2 + IL_0060: ldloc.0 + IL_0061: blt.un.s IL_004d + + IL_0063: ldloca.s V_1 + IL_0065: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f14(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + 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: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldc.i4.1 + IL_0017: stloc.3 + IL_0018: br.s IL_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + 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: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f15(int32 start, + int32 step) 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 (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldc.i4.0 + IL_0013: ldarg.1 + IL_0014: bge.s IL_002d + + IL_0016: ldc.i4.s 10 + IL_0018: ldarg.0 + IL_0019: bge.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_0045 + + IL_0020: ldc.i4.s 10 + IL_0022: ldarg.0 + IL_0023: sub + IL_0024: ldarg.1 + IL_0025: div.un + IL_0026: conv.i8 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: nop + IL_002b: br.s IL_0045 + + IL_002d: ldarg.0 + IL_002e: ldc.i4.s 10 + IL_0030: bge.s IL_0037 + + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: nop + IL_0035: br.s IL_0045 + + IL_0037: ldarg.0 + IL_0038: ldc.i4.s 10 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: not + IL_003d: ldc.i4.1 + IL_003e: add + IL_003f: div.un + IL_0040: conv.i8 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: nop + IL_0045: stloc.0 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.2 + IL_0049: ldarg.0 + IL_004a: stloc.3 + IL_004b: br.s IL_005f + + IL_004d: ldloca.s V_1 + IL_004f: ldloc.3 + IL_0050: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0055: nop + IL_0056: ldloc.3 + IL_0057: ldarg.1 + IL_0058: add + IL_0059: stloc.3 + IL_005a: ldloc.2 + IL_005b: ldc.i4.1 + IL_005c: conv.i8 + IL_005d: add + IL_005e: stloc.2 + IL_005f: ldloc.2 + IL_0060: ldloc.0 + IL_0061: blt.un.s IL_004d + + IL_0063: ldloca.s V_1 + IL_0065: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_006a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f16(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 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: ldarg.0 + 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.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: conv.i8 + IL_000e: ldc.i4.1 + IL_000f: conv.i8 + IL_0010: add + IL_0011: nop + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: ldarg.0 + IL_0017: stloc.3 + IL_0018: br.s IL_002c + + IL_001a: ldloca.s V_1 + IL_001c: ldloc.3 + IL_001d: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0022: nop + IL_0023: ldloc.3 + IL_0024: ldc.i4.1 + 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: ldloc.0 + IL_002e: blt.un.s IL_001a + + IL_0030: ldloca.s V_1 + IL_0032: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0037: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f17(int32 step, + 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 (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldc.i4.1 + IL_0005: ldarg.0 + IL_0006: ldarg.1 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.1 + IL_0016: ldc.i4.1 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.1 + IL_001f: ldc.i4.1 + IL_0020: sub + IL_0021: ldarg.0 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldc.i4.1 + IL_002b: ldarg.1 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldc.i4.1 + IL_0034: ldarg.1 + IL_0035: sub + IL_0036: ldarg.0 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldc.i4.1 + IL_0045: stloc.3 + IL_0046: br.s IL_005a + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0050: nop + IL_0051: ldloc.3 + IL_0052: ldarg.0 + IL_0053: add + IL_0054: stloc.3 + IL_0055: ldloc.2 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.2 + IL_005b: ldloc.0 + IL_005c: blt.un.s IL_0048 + + IL_005e: ldloca.s V_1 + IL_0060: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0065: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f18(int32 start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.1 + IL_0013: bge.s IL_002a + + IL_0015: ldarg.2 + IL_0016: ldarg.0 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0040 + + IL_001e: ldarg.2 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: conv.i8 + IL_0024: ldc.i4.1 + IL_0025: conv.i8 + IL_0026: add + IL_0027: nop + IL_0028: br.s IL_0040 + + IL_002a: ldarg.0 + IL_002b: ldarg.2 + IL_002c: bge.s IL_0033 + + IL_002e: ldc.i4.0 + IL_002f: conv.i8 + IL_0030: nop + IL_0031: br.s IL_0040 + + IL_0033: ldarg.0 + IL_0034: ldarg.2 + IL_0035: sub + IL_0036: ldarg.1 + IL_0037: not + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: div.un + IL_003b: conv.i8 + IL_003c: ldc.i4.1 + IL_003d: conv.i8 + IL_003e: add + IL_003f: nop + IL_0040: stloc.0 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.0 + IL_0045: stloc.3 + IL_0046: br.s IL_005a + + IL_0048: ldloca.s V_1 + IL_004a: ldloc.3 + IL_004b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0050: nop + IL_0051: ldloc.3 + IL_0052: ldarg.1 + IL_0053: add + IL_0054: stloc.3 + IL_0055: ldloc.2 + IL_0056: ldc.i4.1 + IL_0057: conv.i8 + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.2 + IL_005b: ldloc.0 + IL_005c: blt.un.s IL_0048 + + IL_005e: ldloca.s V_1 + IL_0060: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0065: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.3 + IL_001f: ldloc.0 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_0039 + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.s V_4 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.3 + IL_003a: ldloc.1 + IL_003b: blt.un.s IL_0024 + + IL_003d: ldloca.s V_2 + IL_003f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0044: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.3 + IL_001d: ldc.i4.1 + IL_001e: stloc.s V_4 + IL_0020: br.s IL_0037 + + IL_0022: ldloca.s V_2 + IL_0024: ldloc.s V_4 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.s V_4 + IL_0032: ldloc.3 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.3 + IL_0038: ldloc.1 + IL_0039: blt.un.s IL_0022 + + IL_003b: ldloca.s V_2 + IL_003d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0042: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) 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 (int32 V_0, + int32 V_1, + uint64 V_2, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + uint64 V_4, + int32 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldloc.0 + IL_0012: bge.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0021 + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: conv.i8 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: nop + IL_0021: stloc.2 + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: stloc.s V_4 + IL_0026: ldloc.0 + IL_0027: stloc.s V_5 + IL_0029: br.s IL_0042 + + IL_002b: ldloca.s V_3 + IL_002d: ldloc.s V_5 + IL_002f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0034: nop + IL_0035: ldloc.s V_5 + IL_0037: ldc.i4.1 + IL_0038: add + IL_0039: stloc.s V_5 + IL_003b: ldloc.s V_4 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.s V_4 + IL_0042: ldloc.s V_4 + IL_0044: ldloc.2 + IL_0045: blt.un.s IL_002b + + IL_0047: ldloca.s V_3 + IL_0049: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004e: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: ldloc.0 + IL_000b: bge.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001b + + IL_0012: ldc.i4.s 10 + IL_0014: ldloc.0 + IL_0015: sub + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: nop + IL_001b: stloc.1 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.3 + IL_001f: ldloc.0 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_0039 + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: add + IL_0032: stloc.s V_4 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add + IL_0038: stloc.3 + IL_0039: ldloc.3 + IL_003a: ldloc.1 + IL_003b: blt.un.s IL_0024 + + IL_003d: ldloca.s V_2 + IL_003f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0044: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f23(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_0018 + + IL_000b: ldc.i4.1 + IL_000c: ldloc.0 + IL_000d: ldc.i4.s 10 + IL_000f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.0 + IL_001a: ldloc.0 + IL_001b: bge.s IL_0034 + + IL_001d: ldc.i4.s 10 + IL_001f: ldc.i4.1 + IL_0020: bge.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_004c + + IL_0027: ldc.i4.s 10 + IL_0029: ldc.i4.1 + IL_002a: sub + IL_002b: ldloc.0 + IL_002c: div.un + IL_002d: conv.i8 + IL_002e: ldc.i4.1 + IL_002f: conv.i8 + IL_0030: add + IL_0031: nop + IL_0032: br.s IL_004c + + IL_0034: ldc.i4.1 + IL_0035: ldc.i4.s 10 + IL_0037: bge.s IL_003e + + IL_0039: ldc.i4.0 + IL_003a: conv.i8 + IL_003b: nop + IL_003c: br.s IL_004c + + IL_003e: ldc.i4.1 + IL_003f: ldc.i4.s 10 + IL_0041: sub + IL_0042: ldloc.0 + IL_0043: not + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: div.un + IL_0047: conv.i8 + IL_0048: ldc.i4.1 + IL_0049: conv.i8 + IL_004a: add + IL_004b: nop + IL_004c: stloc.1 + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: stloc.3 + IL_0050: ldc.i4.1 + IL_0051: stloc.s V_4 + IL_0053: br.s IL_006a + + IL_0055: ldloca.s V_2 + IL_0057: ldloc.s V_4 + IL_0059: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_005e: nop + IL_005f: ldloc.s V_4 + IL_0061: ldloc.0 + IL_0062: add + IL_0063: stloc.s V_4 + IL_0065: ldloc.3 + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add + IL_0069: stloc.3 + IL_006a: ldloc.3 + IL_006b: ldloc.1 + IL_006c: blt.un.s IL_0055 + + IL_006e: ldloca.s V_2 + IL_0070: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0075: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f24(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: bge.s IL_0011 + + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: nop + IL_000f: br.s IL_0019 + + IL_0011: ldloc.0 + IL_0012: ldc.i4.1 + IL_0013: sub + IL_0014: conv.i8 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: nop + IL_0019: stloc.1 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.3 + IL_001d: ldc.i4.1 + IL_001e: stloc.s V_4 + IL_0020: br.s IL_0037 + + IL_0022: ldloca.s V_2 + IL_0024: ldloc.s V_4 + IL_0026: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002b: nop + IL_002c: ldloc.s V_4 + IL_002e: ldc.i4.1 + IL_002f: add + IL_0030: stloc.s V_4 + IL_0032: ldloc.3 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.3 + IL_0037: ldloc.3 + IL_0038: ldloc.1 + IL_0039: blt.un.s IL_0022 + + IL_003b: ldloca.s V_2 + IL_003d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0042: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f25(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 h) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2, + uint64 V_3, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, + uint64 V_5, + int32 V_6) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldarg.2 + IL_0011: ldnull + IL_0012: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: brtrue.s IL_0027 + + IL_001b: ldloc.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::RangeInt32(int32, + int32, + int32) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldc.i4.0 + IL_0029: ldloc.1 + IL_002a: bge.s IL_0041 + + IL_002c: ldloc.2 + IL_002d: ldloc.0 + IL_002e: bge.s IL_0035 + + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: nop + IL_0033: br.s IL_0057 + + IL_0035: ldloc.2 + IL_0036: ldloc.0 + IL_0037: sub + IL_0038: ldloc.1 + IL_0039: div.un + IL_003a: conv.i8 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: nop + IL_003f: br.s IL_0057 + + IL_0041: ldloc.0 + IL_0042: ldloc.2 + IL_0043: bge.s IL_004a + + IL_0045: ldc.i4.0 + IL_0046: conv.i8 + IL_0047: nop + IL_0048: br.s IL_0057 + + IL_004a: ldloc.0 + IL_004b: ldloc.2 + IL_004c: sub + IL_004d: ldloc.1 + IL_004e: not + IL_004f: ldc.i4.1 + IL_0050: add + IL_0051: div.un + IL_0052: conv.i8 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: nop + IL_0057: stloc.3 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: stloc.s V_5 + IL_005c: ldloc.0 + IL_005d: stloc.s V_6 + IL_005f: br.s IL_0078 + + IL_0061: ldloca.s V_4 + IL_0063: ldloc.s V_6 + IL_0065: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006a: nop + IL_006b: ldloc.s V_6 + IL_006d: ldloc.1 + IL_006e: add + IL_006f: stloc.s V_6 + IL_0071: ldloc.s V_5 + IL_0073: ldc.i4.1 + IL_0074: conv.i8 + IL_0075: add + IL_0076: stloc.s V_5 + IL_0078: ldloc.s V_5 + IL_007a: ldloc.3 + IL_007b: blt.un.s IL_0061 + + IL_007d: ldloca.s V_4 + IL_007f: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0084: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs new file mode 100644 index 00000000000..21fa8db2428 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs @@ -0,0 +1,22 @@ +let f1 () = [|1UL..10UL|] +let f2 () = [|10UL..1UL|] +let f3 () = [|1UL..1UL..10UL|] +let f4 () = [|1UL..2UL..10UL|] +let f5 () = [|10UL..1UL..1UL|] +let f6 start = [|start..10UL|] +let f7 finish = [|1UL..finish|] +let f8 (start: uint64) finish = [|start..finish|] +let f9 start = [|start..1UL..10UL|] +let f10 step = [|1UL..step..10UL|] +let f11 finish = [|1UL..1UL..finish|] +let f12 start step = [|start..step..10UL|] +let f13 start finish = [|start..1UL..finish|] +let f14 step finish = [|1UL..step..finish|] +let f15 (start: uint64) step finish = [|start..step..finish|] +let f16 f = [|f ()..10UL|] +let f17 f = [|1UL..f ()|] +let f18 (f: unit -> uint64) g = [|f ()..g()|] +let f19 f = [|f ()..1UL..10UL|] +let f20 f = [|1UL..f ()..10UL|] +let f21 f = [|1UL..1UL..f ()|] +let f22 (f: unit -> uint64) g h = [|f ()..g ()..h ()|] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl new file mode 100644 index 00000000000..d35ebad1148 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeArrays.fs.il.bsl @@ -0,0 +1,1998 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .method public static uint64[] f1() cil managed + { + + .maxstack 5 + .locals init (uint64[] V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.UInt64 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: stloc.2 + IL_0010: br.s IL_0021 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stelem.i8 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldc.i4.s 10 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0012 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static uint64[] f2() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static uint64[] f3() cil managed + { + + .maxstack 5 + .locals init (uint64[] V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: conv.i8 + IL_0003: conv.ovf.i.un + IL_0004: newarr [runtime]System.UInt64 + IL_0009: stloc.0 + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.1 + IL_000d: ldc.i4.1 + IL_000e: conv.i8 + IL_000f: stloc.2 + IL_0010: br.s IL_0021 + + IL_0012: ldloc.0 + IL_0013: ldloc.1 + IL_0014: conv.i + IL_0015: ldloc.2 + IL_0016: stelem.i8 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add + IL_0020: stloc.1 + IL_0021: ldloc.1 + IL_0022: ldc.i4.s 10 + IL_0024: conv.i8 + IL_0025: blt.un.s IL_0012 + + IL_0027: ldloc.0 + IL_0028: ret + } + + .method public static uint64[] f4() cil managed + { + + .maxstack 5 + .locals init (uint64[] V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.5 + IL_0001: conv.i8 + IL_0002: conv.ovf.i.un + IL_0003: newarr [runtime]System.UInt64 + IL_0008: stloc.0 + IL_0009: ldc.i4.0 + IL_000a: conv.i8 + IL_000b: stloc.1 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: stloc.2 + IL_000f: br.s IL_0020 + + IL_0011: ldloc.0 + IL_0012: ldloc.1 + IL_0013: conv.i + IL_0014: ldloc.2 + IL_0015: stelem.i8 + IL_0016: ldloc.2 + IL_0017: ldc.i4.2 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldc.i4.5 + IL_0022: conv.i8 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.0 + IL_0026: ret + } + + .method public static uint64[] f5() cil managed + { + + .maxstack 8 + IL_0000: call !!0[] [runtime]System.Array::Empty() + IL_0005: ret + } + + .method public static uint64[] f6(uint64 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 + + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret + + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.UInt64 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: stloc.3 + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: br.s IL_0045 + + IL_0033: ldloc.2 + IL_0034: ldloc.3 + IL_0035: conv.i + IL_0036: ldloc.s V_4 + IL_0038: stelem.i8 + IL_0039: ldloc.s V_4 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.3 + IL_0045: ldloc.3 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_0033 + + IL_0049: ldloc.2 + IL_004a: ret + } + + .method public static uint64[] f7(uint64 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.UInt64 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.3 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0044 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i8 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.s V_4 + IL_003f: ldloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.3 + IL_0044: ldloc.3 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0032 + + IL_0048: ldloc.2 + IL_0049: ret + } + + .method public static uint64[] f8(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 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64[] V_3, + bool V_4, + uint64 V_5, + uint64 V_6, + uint64 V_7) + IL_0000: nop + IL_0001: ldarg.1 + 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_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldarg.1 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0025 + + IL_001e: ldarg.1 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add.ovf.un + IL_0024: nop + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: bge.un.s IL_0031 + + IL_002b: call !!0[] [runtime]System.Array::Empty() + IL_0030: ret + + IL_0031: ldloc.2 + IL_0032: conv.ovf.i.un + IL_0033: newarr [runtime]System.UInt64 + IL_0038: stloc.3 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_006c + + IL_003c: ldc.i4.1 + IL_003d: stloc.s V_4 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.s V_5 + IL_0043: ldarg.0 + IL_0044: stloc.s V_6 + IL_0046: br.s IL_0065 + + IL_0048: ldloc.3 + IL_0049: ldloc.s V_5 + IL_004b: conv.i + IL_004c: ldloc.s V_6 + IL_004e: stelem.i8 + IL_004f: ldloc.s V_6 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.s V_6 + IL_0056: ldloc.s V_5 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_5 + IL_005d: ldloc.s V_5 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: cgt.un + IL_0063: stloc.s V_4 + IL_0065: ldloc.s V_4 + IL_0067: brtrue.s IL_0048 + + IL_0069: nop + IL_006a: br.s IL_00a3 + + IL_006c: ldarg.1 + IL_006d: ldarg.0 + IL_006e: bge.un.s IL_0075 + + IL_0070: ldc.i4.0 + IL_0071: conv.i8 + IL_0072: nop + IL_0073: br.s IL_007c + + IL_0075: ldarg.1 + IL_0076: ldarg.0 + IL_0077: sub + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add.ovf.un + IL_007b: nop + IL_007c: stloc.s V_5 + IL_007e: ldc.i4.0 + IL_007f: conv.i8 + IL_0080: stloc.s V_6 + IL_0082: ldarg.0 + IL_0083: stloc.s V_7 + IL_0085: br.s IL_009c + + IL_0087: ldloc.3 + IL_0088: ldloc.s V_6 + IL_008a: conv.i + IL_008b: ldloc.s V_7 + IL_008d: stelem.i8 + IL_008e: ldloc.s V_7 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_7 + IL_0095: ldloc.s V_6 + IL_0097: ldc.i4.1 + IL_0098: conv.i8 + IL_0099: add + IL_009a: stloc.s V_6 + IL_009c: ldloc.s V_6 + IL_009e: ldloc.s V_5 + IL_00a0: blt.un.s IL_0087 + + IL_00a2: nop + IL_00a3: ldloc.3 + IL_00a4: ret + } + + .method public static uint64[] f9(uint64 start) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: stloc.1 + IL_0018: ldloc.1 + IL_0019: ldc.i4.1 + IL_001a: conv.i8 + IL_001b: bge.un.s IL_0023 + + IL_001d: call !!0[] [runtime]System.Array::Empty() + IL_0022: ret + + IL_0023: ldloc.1 + IL_0024: conv.ovf.i.un + IL_0025: newarr [runtime]System.UInt64 + IL_002a: stloc.2 + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: stloc.3 + IL_002e: ldarg.0 + IL_002f: stloc.s V_4 + IL_0031: br.s IL_0045 + + IL_0033: ldloc.2 + IL_0034: ldloc.3 + IL_0035: conv.i + IL_0036: ldloc.s V_4 + IL_0038: stelem.i8 + IL_0039: ldloc.s V_4 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: stloc.s V_4 + IL_0040: ldloc.3 + IL_0041: ldc.i4.1 + IL_0042: conv.i8 + IL_0043: add + IL_0044: stloc.3 + IL_0045: ldloc.3 + IL_0046: ldloc.0 + IL_0047: blt.un.s IL_0033 + + IL_0049: ldloc.2 + IL_004a: ret + } + + .method public static uint64[] f10(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0013 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldc.i4.s 10 + IL_0009: conv.i8 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000f: pop + IL_0010: nop + IL_0011: br.s IL_0014 + + IL_0013: nop + IL_0014: ldc.i4.s 10 + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_002c + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: div.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add.ovf.un + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldloc.0 + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: bge.un.s IL_003a + + IL_0034: call !!0[] [runtime]System.Array::Empty() + IL_0039: ret + + IL_003a: ldloc.1 + IL_003b: conv.ovf.i.un + IL_003c: newarr [runtime]System.UInt64 + IL_0041: stloc.2 + IL_0042: ldc.i4.0 + IL_0043: conv.i8 + IL_0044: stloc.3 + IL_0045: ldc.i4.1 + IL_0046: conv.i8 + IL_0047: stloc.s V_4 + IL_0049: br.s IL_005c + + IL_004b: ldloc.2 + IL_004c: ldloc.3 + IL_004d: conv.i + IL_004e: ldloc.s V_4 + IL_0050: stelem.i8 + IL_0051: ldloc.s V_4 + IL_0053: ldarg.0 + IL_0054: add + IL_0055: stloc.s V_4 + IL_0057: ldloc.3 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.3 + IL_005c: ldloc.3 + IL_005d: ldloc.0 + IL_005e: blt.un.s IL_004b + + IL_0060: ldloc.2 + IL_0061: ret + } + + .method public static uint64[] f11(uint64 finish) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldloc.0 + IL_0015: stloc.1 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0021 + + IL_001b: call !!0[] [runtime]System.Array::Empty() + IL_0020: ret + + IL_0021: ldloc.1 + IL_0022: conv.ovf.i.un + IL_0023: newarr [runtime]System.UInt64 + IL_0028: stloc.2 + IL_0029: ldc.i4.0 + IL_002a: conv.i8 + IL_002b: stloc.3 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: stloc.s V_4 + IL_0030: br.s IL_0044 + + IL_0032: ldloc.2 + IL_0033: ldloc.3 + IL_0034: conv.i + IL_0035: ldloc.s V_4 + IL_0037: stelem.i8 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.s V_4 + IL_003f: ldloc.3 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.3 + IL_0044: ldloc.3 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0032 + + IL_0048: ldloc.2 + IL_0049: ret + } + + .method public static uint64[] f12(uint64 start, + uint64 step) 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 (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0012 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0029 + + IL_001e: ldc.i4.s 10 + IL_0020: conv.i8 + IL_0021: ldarg.0 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldloc.0 + IL_002b: stloc.1 + IL_002c: ldloc.1 + IL_002d: ldc.i4.1 + IL_002e: conv.i8 + IL_002f: bge.un.s IL_0037 + + IL_0031: call !!0[] [runtime]System.Array::Empty() + IL_0036: ret + + IL_0037: ldloc.1 + IL_0038: conv.ovf.i.un + IL_0039: newarr [runtime]System.UInt64 + IL_003e: stloc.2 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.3 + IL_0042: ldarg.0 + IL_0043: stloc.s V_4 + IL_0045: br.s IL_0058 + + IL_0047: ldloc.2 + IL_0048: ldloc.3 + IL_0049: conv.i + IL_004a: ldloc.s V_4 + IL_004c: stelem.i8 + IL_004d: ldloc.s V_4 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.s V_4 + IL_0053: ldloc.3 + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add + IL_0057: stloc.3 + IL_0058: ldloc.3 + IL_0059: ldloc.0 + IL_005a: blt.un.s IL_0047 + + IL_005c: ldloc.2 + IL_005d: ret + } + + .method public static uint64[] f13(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 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64[] V_3, + bool V_4, + uint64 V_5, + uint64 V_6, + uint64 V_7) + IL_0000: nop + IL_0001: ldarg.1 + 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_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldarg.1 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0025 + + IL_001e: ldarg.1 + IL_001f: ldarg.0 + IL_0020: sub + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add.ovf.un + IL_0024: nop + IL_0025: stloc.2 + IL_0026: ldloc.2 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: bge.un.s IL_0031 + + IL_002b: call !!0[] [runtime]System.Array::Empty() + IL_0030: ret + + IL_0031: ldloc.2 + IL_0032: conv.ovf.i.un + IL_0033: newarr [runtime]System.UInt64 + IL_0038: stloc.3 + IL_0039: ldloc.1 + IL_003a: brfalse.s IL_006c + + IL_003c: ldc.i4.1 + IL_003d: stloc.s V_4 + IL_003f: ldc.i4.0 + IL_0040: conv.i8 + IL_0041: stloc.s V_5 + IL_0043: ldarg.0 + IL_0044: stloc.s V_6 + IL_0046: br.s IL_0065 + + IL_0048: ldloc.3 + IL_0049: ldloc.s V_5 + IL_004b: conv.i + IL_004c: ldloc.s V_6 + IL_004e: stelem.i8 + IL_004f: ldloc.s V_6 + IL_0051: ldc.i4.1 + IL_0052: conv.i8 + IL_0053: add + IL_0054: stloc.s V_6 + IL_0056: ldloc.s V_5 + IL_0058: ldc.i4.1 + IL_0059: conv.i8 + IL_005a: add + IL_005b: stloc.s V_5 + IL_005d: ldloc.s V_5 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: cgt.un + IL_0063: stloc.s V_4 + IL_0065: ldloc.s V_4 + IL_0067: brtrue.s IL_0048 + + IL_0069: nop + IL_006a: br.s IL_00a3 + + IL_006c: ldarg.1 + IL_006d: ldarg.0 + IL_006e: bge.un.s IL_0075 + + IL_0070: ldc.i4.0 + IL_0071: conv.i8 + IL_0072: nop + IL_0073: br.s IL_007c + + IL_0075: ldarg.1 + IL_0076: ldarg.0 + IL_0077: sub + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add.ovf.un + IL_007b: nop + IL_007c: stloc.s V_5 + IL_007e: ldc.i4.0 + IL_007f: conv.i8 + IL_0080: stloc.s V_6 + IL_0082: ldarg.0 + IL_0083: stloc.s V_7 + IL_0085: br.s IL_009c + + IL_0087: ldloc.3 + IL_0088: ldloc.s V_6 + IL_008a: conv.i + IL_008b: ldloc.s V_7 + IL_008d: stelem.i8 + IL_008e: ldloc.s V_7 + IL_0090: ldc.i4.1 + IL_0091: conv.i8 + IL_0092: add + IL_0093: stloc.s V_7 + IL_0095: ldloc.s V_6 + IL_0097: ldc.i4.1 + IL_0098: conv.i8 + IL_0099: add + IL_009a: stloc.s V_6 + IL_009c: ldloc.s V_6 + IL_009e: ldloc.s V_5 + IL_00a0: blt.un.s IL_0087 + + IL_00a2: nop + IL_00a3: ldloc.3 + IL_00a4: ret + } + + .method public static uint64[] f14(uint64 step, + 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 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64[] V_2, + uint64 V_3, + uint64 V_4) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldarg.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: bge.un.s IL_001c + + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: nop + IL_001a: br.s IL_0026 + + IL_001c: ldarg.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add.ovf.un + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldloc.0 + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: bge.un.s IL_0034 + + IL_002e: call !!0[] [runtime]System.Array::Empty() + IL_0033: ret + + IL_0034: ldloc.1 + IL_0035: conv.ovf.i.un + IL_0036: newarr [runtime]System.UInt64 + IL_003b: stloc.2 + IL_003c: ldc.i4.0 + IL_003d: conv.i8 + IL_003e: stloc.3 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: stloc.s V_4 + IL_0043: br.s IL_0056 + + IL_0045: ldloc.2 + IL_0046: ldloc.3 + IL_0047: conv.i + IL_0048: ldloc.s V_4 + IL_004a: stelem.i8 + IL_004b: ldloc.s V_4 + IL_004d: ldarg.0 + IL_004e: add + IL_004f: stloc.s V_4 + IL_0051: ldloc.3 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.3 + IL_0056: ldloc.3 + IL_0057: ldloc.0 + IL_0058: blt.un.s IL_0045 + + IL_005a: ldloc.2 + IL_005b: ret + } + + .method public static uint64[] f15(uint64 start, + uint64 step, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64[] V_3, + bool V_4, + uint64 V_5, + uint64 V_6, + uint64 V_7) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldarg.2 + IL_0012: ldarg.0 + IL_0013: bge.un.s IL_001a + + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: nop + IL_0018: br.s IL_0020 + + IL_001a: ldarg.2 + IL_001b: ldarg.0 + IL_001c: sub + IL_001d: ldarg.1 + IL_001e: div.un + IL_001f: nop + IL_0020: stloc.0 + IL_0021: ldloc.0 + IL_0022: ldc.i4.m1 + IL_0023: conv.i8 + IL_0024: ceq + IL_0026: stloc.1 + IL_0027: ldarg.2 + IL_0028: ldarg.0 + IL_0029: bge.un.s IL_0030 + + IL_002b: ldc.i4.0 + IL_002c: conv.i8 + IL_002d: nop + IL_002e: br.s IL_0039 + + IL_0030: ldarg.2 + IL_0031: ldarg.0 + IL_0032: sub + IL_0033: ldarg.1 + IL_0034: div.un + IL_0035: ldc.i4.1 + IL_0036: conv.i8 + IL_0037: add.ovf.un + IL_0038: nop + IL_0039: stloc.2 + IL_003a: ldloc.2 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: bge.un.s IL_0045 + + IL_003f: call !!0[] [runtime]System.Array::Empty() + IL_0044: ret + + IL_0045: ldloc.2 + IL_0046: conv.ovf.i.un + IL_0047: newarr [runtime]System.UInt64 + IL_004c: stloc.3 + IL_004d: ldloc.1 + IL_004e: brfalse.s IL_007f + + IL_0050: ldc.i4.1 + IL_0051: stloc.s V_4 + IL_0053: ldc.i4.0 + IL_0054: conv.i8 + IL_0055: stloc.s V_5 + IL_0057: ldarg.0 + IL_0058: stloc.s V_6 + IL_005a: br.s IL_0078 + + IL_005c: ldloc.3 + IL_005d: ldloc.s V_5 + IL_005f: conv.i + IL_0060: ldloc.s V_6 + IL_0062: stelem.i8 + IL_0063: ldloc.s V_6 + IL_0065: ldarg.1 + IL_0066: add + IL_0067: stloc.s V_6 + IL_0069: ldloc.s V_5 + IL_006b: ldc.i4.1 + IL_006c: conv.i8 + IL_006d: add + IL_006e: stloc.s V_5 + IL_0070: ldloc.s V_5 + IL_0072: ldc.i4.0 + IL_0073: conv.i8 + IL_0074: cgt.un + IL_0076: stloc.s V_4 + IL_0078: ldloc.s V_4 + IL_007a: brtrue.s IL_005c + + IL_007c: nop + IL_007d: br.s IL_00b7 + + IL_007f: ldarg.2 + IL_0080: ldarg.0 + IL_0081: bge.un.s IL_0088 + + IL_0083: ldc.i4.0 + IL_0084: conv.i8 + IL_0085: nop + IL_0086: br.s IL_0091 + + IL_0088: ldarg.2 + IL_0089: ldarg.0 + IL_008a: sub + IL_008b: ldarg.1 + IL_008c: div.un + IL_008d: ldc.i4.1 + IL_008e: conv.i8 + IL_008f: add.ovf.un + IL_0090: nop + IL_0091: stloc.s V_5 + IL_0093: ldc.i4.0 + IL_0094: conv.i8 + IL_0095: stloc.s V_6 + IL_0097: ldarg.0 + IL_0098: stloc.s V_7 + IL_009a: br.s IL_00b0 + + IL_009c: ldloc.3 + IL_009d: ldloc.s V_6 + IL_009f: conv.i + IL_00a0: ldloc.s V_7 + IL_00a2: stelem.i8 + IL_00a3: ldloc.s V_7 + IL_00a5: ldarg.1 + IL_00a6: add + IL_00a7: stloc.s V_7 + IL_00a9: ldloc.s V_6 + IL_00ab: ldc.i4.1 + IL_00ac: conv.i8 + IL_00ad: add + IL_00ae: stloc.s V_6 + IL_00b0: ldloc.s V_6 + IL_00b2: ldloc.s V_5 + IL_00b4: blt.un.s IL_009c + + IL_00b6: nop + IL_00b7: ldloc.3 + IL_00b8: ret + } + + .method public static uint64[] f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: bge.un.s IL_002a + + IL_0024: call !!0[] [runtime]System.Array::Empty() + IL_0029: ret + + IL_002a: ldloc.2 + IL_002b: conv.ovf.i.un + IL_002c: newarr [runtime]System.UInt64 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: stloc.s V_4 + IL_0036: ldloc.0 + IL_0037: stloc.s V_5 + IL_0039: br.s IL_0050 + + IL_003b: ldloc.3 + IL_003c: ldloc.s V_4 + IL_003e: conv.i + IL_003f: ldloc.s V_5 + IL_0041: stelem.i8 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: add + IL_0047: stloc.s V_5 + IL_0049: ldloc.s V_4 + IL_004b: ldc.i4.1 + IL_004c: conv.i8 + IL_004d: add + IL_004e: stloc.s V_4 + IL_0050: ldloc.s V_4 + IL_0052: ldloc.1 + IL_0053: blt.un.s IL_003b + + IL_0055: ldloc.3 + IL_0056: ret + } + + .method public static uint64[] f17(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 + + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.2 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.UInt64 + IL_002f: stloc.3 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_004f + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i8 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: add + IL_004d: stloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: ldloc.1 + IL_0052: blt.un.s IL_003a + + IL_0054: ldloc.3 + IL_0055: ret + } + + .method public static uint64[] f18(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) 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 (uint64 V_0, + uint64 V_1, + uint64 V_2, + bool V_3, + uint64 V_4, + uint64[] V_5, + bool V_6, + uint64 V_7, + uint64 V_8, + uint64 V_9) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldloc.0 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_001d + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: nop + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.m1 + IL_0020: conv.i8 + IL_0021: ceq + IL_0023: stloc.3 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: bge.un.s IL_002d + + IL_0028: ldc.i4.0 + IL_0029: conv.i8 + IL_002a: nop + IL_002b: br.s IL_0034 + + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: sub + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add.ovf.un + IL_0033: nop + IL_0034: stloc.s V_4 + IL_0036: ldloc.s V_4 + IL_0038: ldc.i4.1 + IL_0039: conv.i8 + IL_003a: bge.un.s IL_0042 + + IL_003c: call !!0[] [runtime]System.Array::Empty() + IL_0041: ret + + IL_0042: ldloc.s V_4 + IL_0044: conv.ovf.i.un + IL_0045: newarr [runtime]System.UInt64 + IL_004a: stloc.s V_5 + IL_004c: ldloc.3 + IL_004d: brfalse.s IL_0080 + + IL_004f: ldc.i4.1 + IL_0050: stloc.s V_6 + IL_0052: ldc.i4.0 + IL_0053: conv.i8 + IL_0054: stloc.s V_7 + IL_0056: ldloc.0 + IL_0057: stloc.s V_8 + IL_0059: br.s IL_0079 + + IL_005b: ldloc.s V_5 + IL_005d: ldloc.s V_7 + IL_005f: conv.i + IL_0060: ldloc.s V_8 + IL_0062: stelem.i8 + IL_0063: ldloc.s V_8 + IL_0065: ldc.i4.1 + IL_0066: conv.i8 + IL_0067: add + IL_0068: stloc.s V_8 + IL_006a: ldloc.s V_7 + IL_006c: ldc.i4.1 + IL_006d: conv.i8 + IL_006e: add + IL_006f: stloc.s V_7 + IL_0071: ldloc.s V_7 + IL_0073: ldc.i4.0 + IL_0074: conv.i8 + IL_0075: cgt.un + IL_0077: stloc.s V_6 + IL_0079: ldloc.s V_6 + IL_007b: brtrue.s IL_005b + + IL_007d: nop + IL_007e: br.s IL_00b8 + + IL_0080: ldloc.1 + IL_0081: ldloc.0 + IL_0082: bge.un.s IL_0089 + + IL_0084: ldc.i4.0 + IL_0085: conv.i8 + IL_0086: nop + IL_0087: br.s IL_0090 + + IL_0089: ldloc.1 + IL_008a: ldloc.0 + IL_008b: sub + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add.ovf.un + IL_008f: nop + IL_0090: stloc.s V_7 + IL_0092: ldc.i4.0 + IL_0093: conv.i8 + IL_0094: stloc.s V_8 + IL_0096: ldloc.0 + IL_0097: stloc.s V_9 + IL_0099: br.s IL_00b1 + + IL_009b: ldloc.s V_5 + IL_009d: ldloc.s V_8 + IL_009f: conv.i + IL_00a0: ldloc.s V_9 + IL_00a2: stelem.i8 + IL_00a3: ldloc.s V_9 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_9 + IL_00aa: ldloc.s V_8 + IL_00ac: ldc.i4.1 + IL_00ad: conv.i8 + IL_00ae: add + IL_00af: stloc.s V_8 + IL_00b1: ldloc.s V_8 + IL_00b3: ldloc.s V_7 + IL_00b5: blt.un.s IL_009b + + IL_00b7: nop + IL_00b8: ldloc.s V_5 + IL_00ba: ret + } + + .method public static uint64[] f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldloc.1 + IL_001e: stloc.2 + IL_001f: ldloc.2 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: bge.un.s IL_002a + + IL_0024: call !!0[] [runtime]System.Array::Empty() + IL_0029: ret + + IL_002a: ldloc.2 + IL_002b: conv.ovf.i.un + IL_002c: newarr [runtime]System.UInt64 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: conv.i8 + IL_0034: stloc.s V_4 + IL_0036: ldloc.0 + IL_0037: stloc.s V_5 + IL_0039: br.s IL_0050 + + IL_003b: ldloc.3 + IL_003c: ldloc.s V_4 + IL_003e: conv.i + IL_003f: ldloc.s V_5 + IL_0041: stelem.i8 + IL_0042: ldloc.s V_5 + IL_0044: ldc.i4.1 + IL_0045: conv.i8 + IL_0046: add + IL_0047: stloc.s V_5 + IL_0049: ldloc.s V_4 + IL_004b: ldc.i4.1 + IL_004c: conv.i8 + IL_004d: add + IL_004e: stloc.s V_4 + IL_0050: ldloc.s V_4 + IL_0052: ldloc.1 + IL_0053: blt.un.s IL_003b + + IL_0055: ldloc.3 + IL_0056: ret + } + + .method public static uint64[] f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_001a + + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: ldloc.0 + IL_000e: ldc.i4.s 10 + IL_0010: conv.i8 + IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0016: pop + IL_0017: nop + IL_0018: br.s IL_001b + + IL_001a: nop + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_0033 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: div.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: nop + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: stloc.2 + IL_0036: ldloc.2 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: bge.un.s IL_0041 + + IL_003b: call !!0[] [runtime]System.Array::Empty() + IL_0040: ret + + IL_0041: ldloc.2 + IL_0042: conv.ovf.i.un + IL_0043: newarr [runtime]System.UInt64 + IL_0048: stloc.3 + IL_0049: ldc.i4.0 + IL_004a: conv.i8 + IL_004b: stloc.s V_4 + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: stloc.s V_5 + IL_0051: br.s IL_0067 + + IL_0053: ldloc.3 + IL_0054: ldloc.s V_4 + IL_0056: conv.i + IL_0057: ldloc.s V_5 + IL_0059: stelem.i8 + IL_005a: ldloc.s V_5 + IL_005c: ldloc.0 + IL_005d: add + IL_005e: stloc.s V_5 + IL_0060: ldloc.s V_4 + IL_0062: ldc.i4.1 + IL_0063: conv.i8 + IL_0064: add + IL_0065: stloc.s V_4 + IL_0067: ldloc.s V_4 + IL_0069: ldloc.1 + IL_006a: blt.un.s IL_0053 + + IL_006c: ldloc.3 + IL_006d: ret + } + + .method public static uint64[] f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64[] V_3, + uint64 V_4, + uint64 V_5) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: stloc.2 + IL_001d: ldloc.2 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0028 + + IL_0022: call !!0[] [runtime]System.Array::Empty() + IL_0027: ret + + IL_0028: ldloc.2 + IL_0029: conv.ovf.i.un + IL_002a: newarr [runtime]System.UInt64 + IL_002f: stloc.3 + IL_0030: ldc.i4.0 + IL_0031: conv.i8 + IL_0032: stloc.s V_4 + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: stloc.s V_5 + IL_0038: br.s IL_004f + + IL_003a: ldloc.3 + IL_003b: ldloc.s V_4 + IL_003d: conv.i + IL_003e: ldloc.s V_5 + IL_0040: stelem.i8 + IL_0041: ldloc.s V_5 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.s V_5 + IL_0048: ldloc.s V_4 + IL_004a: ldc.i4.1 + IL_004b: conv.i8 + IL_004c: add + IL_004d: stloc.s V_4 + IL_004f: ldloc.s V_4 + IL_0051: ldloc.1 + IL_0052: blt.un.s IL_003a + + IL_0054: ldloc.3 + IL_0055: ret + } + + .method public static uint64[] f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 h) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64 V_3, + bool V_4, + uint64 V_5, + uint64[] V_6, + bool V_7, + uint64 V_8, + uint64 V_9, + uint64 V_10) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldarg.2 + IL_0011: ldnull + IL_0012: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: brtrue.s IL_0027 + + IL_001b: ldloc.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::RangeUInt64(uint64, + uint64, + uint64) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldloc.2 + IL_0029: ldloc.0 + IL_002a: bge.un.s IL_0031 + + IL_002c: ldc.i4.0 + IL_002d: conv.i8 + IL_002e: nop + IL_002f: br.s IL_0037 + + IL_0031: ldloc.2 + IL_0032: ldloc.0 + IL_0033: sub + IL_0034: ldloc.1 + IL_0035: div.un + IL_0036: nop + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldc.i4.m1 + IL_003a: conv.i8 + IL_003b: ceq + IL_003d: stloc.s V_4 + IL_003f: ldloc.2 + IL_0040: ldloc.0 + IL_0041: bge.un.s IL_0048 + + IL_0043: ldc.i4.0 + IL_0044: conv.i8 + IL_0045: nop + IL_0046: br.s IL_0051 + + IL_0048: ldloc.2 + IL_0049: ldloc.0 + IL_004a: sub + IL_004b: ldloc.1 + IL_004c: div.un + IL_004d: ldc.i4.1 + IL_004e: conv.i8 + IL_004f: add.ovf.un + IL_0050: nop + IL_0051: stloc.s V_5 + IL_0053: ldloc.s V_5 + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: bge.un.s IL_005f + + IL_0059: call !!0[] [runtime]System.Array::Empty() + IL_005e: ret + + IL_005f: ldloc.s V_5 + IL_0061: conv.ovf.i.un + IL_0062: newarr [runtime]System.UInt64 + IL_0067: stloc.s V_6 + IL_0069: ldloc.s V_4 + IL_006b: brfalse.s IL_009d + + IL_006d: ldc.i4.1 + IL_006e: stloc.s V_7 + IL_0070: ldc.i4.0 + IL_0071: conv.i8 + IL_0072: stloc.s V_8 + IL_0074: ldloc.0 + IL_0075: stloc.s V_9 + IL_0077: br.s IL_0096 + + IL_0079: ldloc.s V_6 + IL_007b: ldloc.s V_8 + IL_007d: conv.i + IL_007e: ldloc.s V_9 + IL_0080: stelem.i8 + IL_0081: ldloc.s V_9 + IL_0083: ldloc.1 + IL_0084: add + IL_0085: stloc.s V_9 + IL_0087: ldloc.s V_8 + IL_0089: ldc.i4.1 + IL_008a: conv.i8 + IL_008b: add + IL_008c: stloc.s V_8 + IL_008e: ldloc.s V_8 + IL_0090: ldc.i4.0 + IL_0091: conv.i8 + IL_0092: cgt.un + IL_0094: stloc.s V_7 + IL_0096: ldloc.s V_7 + IL_0098: brtrue.s IL_0079 + + IL_009a: nop + IL_009b: br.s IL_00d6 + + IL_009d: ldloc.2 + IL_009e: ldloc.0 + IL_009f: bge.un.s IL_00a6 + + IL_00a1: ldc.i4.0 + IL_00a2: conv.i8 + IL_00a3: nop + IL_00a4: br.s IL_00af + + IL_00a6: ldloc.2 + IL_00a7: ldloc.0 + IL_00a8: sub + IL_00a9: ldloc.1 + IL_00aa: div.un + IL_00ab: ldc.i4.1 + IL_00ac: conv.i8 + IL_00ad: add.ovf.un + IL_00ae: nop + IL_00af: stloc.s V_8 + IL_00b1: ldc.i4.0 + IL_00b2: conv.i8 + IL_00b3: stloc.s V_9 + IL_00b5: ldloc.0 + IL_00b6: stloc.s V_10 + IL_00b8: br.s IL_00cf + + IL_00ba: ldloc.s V_6 + IL_00bc: ldloc.s V_9 + IL_00be: conv.i + IL_00bf: ldloc.s V_10 + IL_00c1: stelem.i8 + IL_00c2: ldloc.s V_10 + IL_00c4: ldloc.1 + IL_00c5: add + IL_00c6: stloc.s V_10 + IL_00c8: ldloc.s V_9 + IL_00ca: ldc.i4.1 + IL_00cb: conv.i8 + IL_00cc: add + IL_00cd: stloc.s V_9 + IL_00cf: ldloc.s V_9 + IL_00d1: ldloc.s V_8 + IL_00d3: blt.un.s IL_00ba + + IL_00d5: nop + IL_00d6: ldloc.s V_6 + IL_00d8: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs new file mode 100644 index 00000000000..b1236c04160 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs @@ -0,0 +1,22 @@ +let f1 () = [1UL..10UL] +let f2 () = [10UL..1UL] +let f3 () = [1UL..1UL..10UL] +let f4 () = [1UL..2UL..10UL] +let f5 () = [10UL..1UL..1UL] +let f6 start = [start..10UL] +let f7 finish = [1UL..finish] +let f8 (start: uint64) finish = [start..finish] +let f9 start = [start..1UL..10UL] +let f10 step = [1UL..step..10UL] +let f11 finish = [1UL..1UL..finish] +let f12 start step = [start..step..10UL] +let f13 start finish = [start..1UL..finish] +let f14 step finish = [1UL..step..finish] +let f15 (start: uint64) step finish = [start..step..finish] +let f16 f = [f ()..10UL] +let f17 f = [1UL..f ()] +let f18 (f: unit -> uint64) g = [f ()..g()] +let f19 f = [f ()..1UL..10UL] +let f20 f = [1UL..f ()..10UL] +let f21 f = [1UL..1UL..f ()] +let f22 (f: unit -> uint64) g h = [f ()..g ()..h ()] diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl new file mode 100644 index 00000000000..acf670b4144 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ComputedCollections/UInt64RangeLists.fs.il.bsl @@ -0,0 +1,1651 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f1() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.s 10 + IL_001e: conv.i8 + IL_001f: blt.un.s IL_0008 + + IL_0021: ldloca.s V_0 + IL_0023: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0028: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f2() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f3() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.1 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.s 10 + IL_001e: conv.i8 + IL_001f: blt.un.s IL_0008 + + IL_0021: ldloca.s V_0 + IL_0023: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0028: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f4() cil managed + { + + .maxstack 4 + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: stloc.2 + IL_0006: br.s IL_001b + + IL_0008: ldloca.s V_0 + IL_000a: ldloc.2 + IL_000b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0010: nop + IL_0011: ldloc.2 + IL_0012: ldc.i4.2 + IL_0013: conv.i8 + IL_0014: add + IL_0015: stloc.2 + IL_0016: ldloc.1 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: add + IL_001a: stloc.1 + IL_001b: ldloc.1 + IL_001c: ldc.i4.5 + IL_001d: conv.i8 + IL_001e: blt.un.s IL_0008 + + IL_0020: ldloca.s V_0 + IL_0022: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0027: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f5() cil managed + { + + .maxstack 8 + IL_0000: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0005: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f6(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_0030 + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.3 + IL_002b: ldloc.2 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_001d + + IL_0034: ldloca.s V_1 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f7(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: stloc.3 + IL_001a: br.s IL_002f + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001c + + IL_0033: ldloca.s V_1 + IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f8(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, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + bool V_3, + uint64 V_4, + uint64 V_5, + uint64 V_6) + IL_0000: nop + IL_0001: ldarg.1 + 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_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0048 + + IL_0018: ldc.i4.1 + IL_0019: stloc.3 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.s V_4 + IL_001e: ldarg.0 + IL_001f: stloc.s V_5 + IL_0021: br.s IL_0042 + + IL_0023: ldloca.s V_2 + IL_0025: ldloc.s V_5 + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.s V_5 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.s V_5 + IL_0034: ldloc.s V_4 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.s V_4 + IL_003b: ldloc.s V_4 + IL_003d: ldc.i4.0 + IL_003e: conv.i8 + IL_003f: cgt.un + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: brtrue.s IL_0023 + + IL_0045: nop + IL_0046: br.s IL_0082 + + IL_0048: ldarg.1 + IL_0049: ldarg.0 + IL_004a: bge.un.s IL_0051 + + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: nop + IL_004f: br.s IL_0058 + + IL_0051: ldarg.1 + IL_0052: ldarg.0 + IL_0053: sub + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add.ovf.un + IL_0057: nop + IL_0058: stloc.s V_4 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.s V_5 + IL_005e: ldarg.0 + IL_005f: stloc.s V_6 + IL_0061: br.s IL_007b + + IL_0063: ldloca.s V_2 + IL_0065: ldloc.s V_6 + IL_0067: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006c: nop + IL_006d: ldloc.s V_6 + IL_006f: ldc.i4.1 + IL_0070: conv.i8 + IL_0071: add + IL_0072: stloc.s V_6 + IL_0074: ldloc.s V_5 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.s V_5 + IL_007b: ldloc.s V_5 + IL_007d: ldloc.s V_4 + IL_007f: blt.un.s IL_0063 + + IL_0081: nop + IL_0082: ldloca.s V_2 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f9(uint64 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldc.i4.s 10 + IL_0003: conv.i8 + IL_0004: ldarg.0 + IL_0005: bge.un.s IL_000c + + IL_0007: ldc.i4.0 + IL_0008: conv.i8 + IL_0009: nop + IL_000a: br.s IL_0015 + + IL_000c: ldc.i4.s 10 + IL_000e: conv.i8 + IL_000f: ldarg.0 + IL_0010: sub + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.2 + IL_0019: ldarg.0 + IL_001a: stloc.3 + IL_001b: br.s IL_0030 + + IL_001d: ldloca.s V_1 + IL_001f: ldloc.3 + IL_0020: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0025: nop + IL_0026: ldloc.3 + IL_0027: ldc.i4.1 + IL_0028: conv.i8 + IL_0029: add + IL_002a: stloc.3 + IL_002b: ldloc.2 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.2 + IL_0030: ldloc.2 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_001d + + IL_0034: ldloca.s V_1 + IL_0036: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f10(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0013 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldc.i4.s 10 + IL_0009: conv.i8 + IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000f: pop + IL_0010: nop + IL_0011: br.s IL_0014 + + IL_0013: nop + IL_0014: ldc.i4.s 10 + IL_0016: conv.i8 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: bge.un.s IL_0020 + + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: nop + IL_001e: br.s IL_002c + + IL_0020: ldc.i4.s 10 + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: sub + IL_0026: ldarg.0 + IL_0027: div.un + IL_0028: ldc.i4.1 + IL_0029: conv.i8 + IL_002a: add.ovf.un + IL_002b: nop + IL_002c: stloc.0 + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: stloc.2 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: stloc.3 + IL_0033: br.s IL_0047 + + IL_0035: ldloca.s V_1 + IL_0037: ldloc.3 + IL_0038: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003d: nop + IL_003e: ldloc.3 + IL_003f: ldarg.0 + IL_0040: add + IL_0041: stloc.3 + IL_0042: ldloc.2 + IL_0043: ldc.i4.1 + IL_0044: conv.i8 + IL_0045: add + IL_0046: stloc.2 + IL_0047: ldloc.2 + IL_0048: ldloc.0 + IL_0049: blt.un.s IL_0035 + + IL_004b: ldloca.s V_1 + IL_004d: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0052: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f11(uint64 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldc.i4.1 + IL_0003: conv.i8 + IL_0004: bge.un.s IL_000b + + IL_0006: ldc.i4.0 + IL_0007: conv.i8 + IL_0008: nop + IL_0009: br.s IL_0013 + + IL_000b: ldarg.0 + IL_000c: ldc.i4.1 + IL_000d: conv.i8 + IL_000e: sub + IL_000f: ldc.i4.1 + IL_0010: conv.i8 + IL_0011: add.ovf.un + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: stloc.2 + IL_0017: ldc.i4.1 + IL_0018: conv.i8 + IL_0019: stloc.3 + IL_001a: br.s IL_002f + + IL_001c: ldloca.s V_1 + IL_001e: ldloc.3 + IL_001f: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0024: nop + IL_0025: ldloc.3 + IL_0026: ldc.i4.1 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.3 + IL_002a: ldloc.2 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.2 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001c + + IL_0033: ldloca.s V_1 + IL_0035: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_003a: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f12(uint64 start, + uint64 step) 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 (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0012 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: bge.un.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0029 + + IL_001e: ldc.i4.s 10 + IL_0020: conv.i8 + IL_0021: ldarg.0 + IL_0022: sub + IL_0023: ldarg.1 + IL_0024: div.un + IL_0025: ldc.i4.1 + IL_0026: conv.i8 + IL_0027: add.ovf.un + IL_0028: nop + IL_0029: stloc.0 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: ldarg.0 + IL_002e: stloc.3 + IL_002f: br.s IL_0043 + + IL_0031: ldloca.s V_1 + IL_0033: ldloc.3 + IL_0034: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0039: nop + IL_003a: ldloc.3 + IL_003b: ldarg.1 + IL_003c: add + IL_003d: stloc.3 + IL_003e: ldloc.2 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.2 + IL_0043: ldloc.2 + IL_0044: ldloc.0 + IL_0045: blt.un.s IL_0031 + + IL_0047: ldloca.s V_1 + IL_0049: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004e: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f13(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, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + bool V_3, + uint64 V_4, + uint64 V_5, + uint64 V_6) + IL_0000: nop + IL_0001: ldarg.1 + 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_000e + + IL_000a: ldarg.1 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: nop + IL_000e: stloc.0 + IL_000f: ldloc.0 + IL_0010: ldc.i4.m1 + IL_0011: conv.i8 + IL_0012: ceq + IL_0014: stloc.1 + IL_0015: ldloc.1 + IL_0016: brfalse.s IL_0048 + + IL_0018: ldc.i4.1 + IL_0019: stloc.3 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.s V_4 + IL_001e: ldarg.0 + IL_001f: stloc.s V_5 + IL_0021: br.s IL_0042 + + IL_0023: ldloca.s V_2 + IL_0025: ldloc.s V_5 + IL_0027: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002c: nop + IL_002d: ldloc.s V_5 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.s V_5 + IL_0034: ldloc.s V_4 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.s V_4 + IL_003b: ldloc.s V_4 + IL_003d: ldc.i4.0 + IL_003e: conv.i8 + IL_003f: cgt.un + IL_0041: stloc.3 + IL_0042: ldloc.3 + IL_0043: brtrue.s IL_0023 + + IL_0045: nop + IL_0046: br.s IL_0082 + + IL_0048: ldarg.1 + IL_0049: ldarg.0 + IL_004a: bge.un.s IL_0051 + + IL_004c: ldc.i4.0 + IL_004d: conv.i8 + IL_004e: nop + IL_004f: br.s IL_0058 + + IL_0051: ldarg.1 + IL_0052: ldarg.0 + IL_0053: sub + IL_0054: ldc.i4.1 + IL_0055: conv.i8 + IL_0056: add.ovf.un + IL_0057: nop + IL_0058: stloc.s V_4 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.s V_5 + IL_005e: ldarg.0 + IL_005f: stloc.s V_6 + IL_0061: br.s IL_007b + + IL_0063: ldloca.s V_2 + IL_0065: ldloc.s V_6 + IL_0067: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_006c: nop + IL_006d: ldloc.s V_6 + IL_006f: ldc.i4.1 + IL_0070: conv.i8 + IL_0071: add + IL_0072: stloc.s V_6 + IL_0074: ldloc.s V_5 + IL_0076: ldc.i4.1 + IL_0077: conv.i8 + IL_0078: add + IL_0079: stloc.s V_5 + IL_007b: ldloc.s V_5 + IL_007d: ldloc.s V_4 + IL_007f: blt.un.s IL_0063 + + IL_0081: nop + IL_0082: ldloca.s V_2 + IL_0084: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0089: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f14(uint64 step, + 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 5 + .locals init (uint64 V_0, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + uint64 V_3) + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: brtrue.s IL_0011 + + IL_0004: ldc.i4.1 + IL_0005: conv.i8 + IL_0006: ldarg.0 + IL_0007: ldarg.1 + IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000d: pop + IL_000e: nop + IL_000f: br.s IL_0012 + + IL_0011: nop + IL_0012: ldarg.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: bge.un.s IL_001c + + IL_0017: ldc.i4.0 + IL_0018: conv.i8 + IL_0019: nop + IL_001a: br.s IL_0026 + + IL_001c: ldarg.1 + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: sub + IL_0020: ldarg.0 + IL_0021: div.un + IL_0022: ldc.i4.1 + IL_0023: conv.i8 + IL_0024: add.ovf.un + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.3 + IL_002d: br.s IL_0041 + + IL_002f: ldloca.s V_1 + IL_0031: ldloc.3 + IL_0032: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0037: nop + IL_0038: ldloc.3 + IL_0039: ldarg.0 + IL_003a: add + IL_003b: stloc.3 + IL_003c: ldloc.2 + IL_003d: ldc.i4.1 + IL_003e: conv.i8 + IL_003f: add + IL_0040: stloc.2 + IL_0041: ldloc.2 + IL_0042: ldloc.0 + IL_0043: blt.un.s IL_002f + + IL_0045: ldloca.s V_1 + IL_0047: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_004c: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f15(uint64 start, + uint64 step, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + bool V_3, + uint64 V_4, + uint64 V_5, + uint64 V_6) + IL_0000: nop + IL_0001: ldarg.1 + IL_0002: brtrue.s IL_0010 + + IL_0004: ldarg.0 + IL_0005: ldarg.1 + IL_0006: ldarg.2 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldarg.2 + IL_0012: ldarg.0 + IL_0013: bge.un.s IL_001a + + IL_0015: ldc.i4.0 + IL_0016: conv.i8 + IL_0017: nop + IL_0018: br.s IL_0020 + + IL_001a: ldarg.2 + IL_001b: ldarg.0 + IL_001c: sub + IL_001d: ldarg.1 + IL_001e: div.un + IL_001f: nop + IL_0020: stloc.0 + IL_0021: ldloc.0 + IL_0022: ldc.i4.m1 + IL_0023: conv.i8 + IL_0024: ceq + IL_0026: stloc.1 + IL_0027: ldloc.1 + IL_0028: brfalse.s IL_0059 + + IL_002a: ldc.i4.1 + IL_002b: stloc.3 + IL_002c: ldc.i4.0 + IL_002d: conv.i8 + IL_002e: stloc.s V_4 + IL_0030: ldarg.0 + IL_0031: stloc.s V_5 + IL_0033: br.s IL_0053 + + IL_0035: ldloca.s V_2 + IL_0037: ldloc.s V_5 + IL_0039: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003e: nop + IL_003f: ldloc.s V_5 + IL_0041: ldarg.1 + IL_0042: add + IL_0043: stloc.s V_5 + IL_0045: ldloc.s V_4 + IL_0047: ldc.i4.1 + IL_0048: conv.i8 + IL_0049: add + IL_004a: stloc.s V_4 + IL_004c: ldloc.s V_4 + IL_004e: ldc.i4.0 + IL_004f: conv.i8 + IL_0050: cgt.un + IL_0052: stloc.3 + IL_0053: ldloc.3 + IL_0054: brtrue.s IL_0035 + + IL_0056: nop + IL_0057: br.s IL_0094 + + IL_0059: ldarg.2 + IL_005a: ldarg.0 + IL_005b: bge.un.s IL_0062 + + IL_005d: ldc.i4.0 + IL_005e: conv.i8 + IL_005f: nop + IL_0060: br.s IL_006b + + IL_0062: ldarg.2 + IL_0063: ldarg.0 + IL_0064: sub + IL_0065: ldarg.1 + IL_0066: div.un + IL_0067: ldc.i4.1 + IL_0068: conv.i8 + IL_0069: add.ovf.un + IL_006a: nop + IL_006b: stloc.s V_4 + IL_006d: ldc.i4.0 + IL_006e: conv.i8 + IL_006f: stloc.s V_5 + IL_0071: ldarg.0 + IL_0072: stloc.s V_6 + IL_0074: br.s IL_008d + + IL_0076: ldloca.s V_2 + IL_0078: ldloc.s V_6 + IL_007a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007f: nop + IL_0080: ldloc.s V_6 + IL_0082: ldarg.1 + IL_0083: add + IL_0084: stloc.s V_6 + IL_0086: ldloc.s V_5 + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: stloc.s V_5 + IL_008d: ldloc.s V_5 + IL_008f: ldloc.s V_4 + IL_0091: blt.un.s IL_0076 + + IL_0093: nop + IL_0094: ldloca.s V_2 + IL_0096: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f16(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: ldloc.0 + IL_0021: stloc.s V_4 + IL_0023: br.s IL_003b + + IL_0025: ldloca.s V_2 + IL_0027: ldloc.s V_4 + IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002e: nop + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.s V_4 + IL_0036: ldloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add + IL_003a: stloc.3 + IL_003b: ldloc.3 + IL_003c: ldloc.1 + IL_003d: blt.un.s IL_0025 + + IL_003f: ldloca.s V_2 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0046: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f17(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.3 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_003a + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.3 + IL_003b: ldloc.1 + IL_003c: blt.un.s IL_0024 + + IL_003e: ldloca.s V_2 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f18(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g) 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, + uint64 V_2, + bool V_3, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_4, + bool V_5, + uint64 V_6, + uint64 V_7, + uint64 V_8) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldloc.1 + IL_0011: ldloc.0 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_001d + + IL_0019: ldloc.1 + IL_001a: ldloc.0 + IL_001b: sub + IL_001c: nop + IL_001d: stloc.2 + IL_001e: ldloc.2 + IL_001f: ldc.i4.m1 + IL_0020: conv.i8 + IL_0021: ceq + IL_0023: stloc.3 + IL_0024: ldloc.3 + IL_0025: brfalse.s IL_005a + + IL_0027: ldc.i4.1 + IL_0028: stloc.s V_5 + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: stloc.s V_6 + IL_002e: ldloc.0 + IL_002f: stloc.s V_7 + IL_0031: br.s IL_0053 + + IL_0033: ldloca.s V_4 + IL_0035: ldloc.s V_7 + IL_0037: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_003c: nop + IL_003d: ldloc.s V_7 + IL_003f: ldc.i4.1 + IL_0040: conv.i8 + IL_0041: add + IL_0042: stloc.s V_7 + IL_0044: ldloc.s V_6 + IL_0046: ldc.i4.1 + IL_0047: conv.i8 + IL_0048: add + IL_0049: stloc.s V_6 + IL_004b: ldloc.s V_6 + IL_004d: ldc.i4.0 + IL_004e: conv.i8 + IL_004f: cgt.un + IL_0051: stloc.s V_5 + IL_0053: ldloc.s V_5 + IL_0055: brtrue.s IL_0033 + + IL_0057: nop + IL_0058: br.s IL_0094 + + IL_005a: ldloc.1 + IL_005b: ldloc.0 + IL_005c: bge.un.s IL_0063 + + IL_005e: ldc.i4.0 + IL_005f: conv.i8 + IL_0060: nop + IL_0061: br.s IL_006a + + IL_0063: ldloc.1 + IL_0064: ldloc.0 + IL_0065: sub + IL_0066: ldc.i4.1 + IL_0067: conv.i8 + IL_0068: add.ovf.un + IL_0069: nop + IL_006a: stloc.s V_6 + IL_006c: ldc.i4.0 + IL_006d: conv.i8 + IL_006e: stloc.s V_7 + IL_0070: ldloc.0 + IL_0071: stloc.s V_8 + IL_0073: br.s IL_008d + + IL_0075: ldloca.s V_4 + IL_0077: ldloc.s V_8 + IL_0079: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_007e: nop + IL_007f: ldloc.s V_8 + IL_0081: ldc.i4.1 + IL_0082: conv.i8 + IL_0083: add + IL_0084: stloc.s V_8 + IL_0086: ldloc.s V_7 + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: stloc.s V_7 + IL_008d: ldloc.s V_7 + IL_008f: ldloc.s V_6 + IL_0091: blt.un.s IL_0075 + + IL_0093: nop + IL_0094: ldloca.s V_4 + IL_0096: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_009b: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f19(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldc.i4.s 10 + IL_000a: conv.i8 + IL_000b: ldloc.0 + IL_000c: bge.un.s IL_0013 + + IL_000e: ldc.i4.0 + IL_000f: conv.i8 + IL_0010: nop + IL_0011: br.s IL_001c + + IL_0013: ldc.i4.s 10 + IL_0015: conv.i8 + IL_0016: ldloc.0 + IL_0017: sub + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: nop + IL_001c: stloc.1 + IL_001d: ldc.i4.0 + IL_001e: conv.i8 + IL_001f: stloc.3 + IL_0020: ldloc.0 + IL_0021: stloc.s V_4 + IL_0023: br.s IL_003b + + IL_0025: ldloca.s V_2 + IL_0027: ldloc.s V_4 + IL_0029: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002e: nop + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: conv.i8 + IL_0033: add + IL_0034: stloc.s V_4 + IL_0036: ldloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: add + IL_003a: stloc.3 + IL_003b: ldloc.3 + IL_003c: ldloc.1 + IL_003d: blt.un.s IL_0025 + + IL_003f: ldloca.s V_2 + IL_0041: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0046: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f20(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: brtrue.s IL_001a + + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: ldloc.0 + IL_000e: ldc.i4.s 10 + IL_0010: conv.i8 + IL_0011: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0016: pop + IL_0017: nop + IL_0018: br.s IL_001b + + IL_001a: nop + IL_001b: ldc.i4.s 10 + IL_001d: conv.i8 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: bge.un.s IL_0027 + + IL_0022: ldc.i4.0 + IL_0023: conv.i8 + IL_0024: nop + IL_0025: br.s IL_0033 + + IL_0027: ldc.i4.s 10 + IL_0029: conv.i8 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: sub + IL_002d: ldloc.0 + IL_002e: div.un + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add.ovf.un + IL_0032: nop + IL_0033: stloc.1 + IL_0034: ldc.i4.0 + IL_0035: conv.i8 + IL_0036: stloc.3 + IL_0037: ldc.i4.1 + IL_0038: conv.i8 + IL_0039: stloc.s V_4 + IL_003b: br.s IL_0052 + + IL_003d: ldloca.s V_2 + IL_003f: ldloc.s V_4 + IL_0041: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0046: nop + IL_0047: ldloc.s V_4 + IL_0049: ldloc.0 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldloc.1 + IL_0054: blt.un.s IL_003d + + IL_0056: ldloca.s V_2 + IL_0058: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_005d: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f21(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldloc.0 + IL_0009: ldc.i4.1 + IL_000a: conv.i8 + IL_000b: bge.un.s IL_0012 + + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: nop + IL_0010: br.s IL_001a + + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: sub + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add.ovf.un + IL_0019: nop + IL_001a: stloc.1 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: stloc.3 + IL_001e: ldc.i4.1 + IL_001f: conv.i8 + IL_0020: stloc.s V_4 + IL_0022: br.s IL_003a + + IL_0024: ldloca.s V_2 + IL_0026: ldloc.s V_4 + IL_0028: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002d: nop + IL_002e: ldloc.s V_4 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.3 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.3 + IL_003a: ldloc.3 + IL_003b: ldloc.1 + IL_003c: blt.un.s IL_0024 + + IL_003e: ldloca.s V_2 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: ret + } + + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 + f22(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 f, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 g, + class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2 h) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2, + uint64 V_3, + bool V_4, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_5, + bool V_6, + uint64 V_7, + uint64 V_8, + uint64 V_9) + IL_0000: ldarg.0 + IL_0001: ldnull + IL_0002: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0007: stloc.0 + IL_0008: ldarg.1 + IL_0009: ldnull + IL_000a: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_000f: stloc.1 + IL_0010: ldarg.2 + IL_0011: ldnull + IL_0012: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_0017: stloc.2 + IL_0018: ldloc.1 + IL_0019: brtrue.s IL_0027 + + IL_001b: ldloc.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::RangeUInt64(uint64, + uint64, + uint64) + IL_0023: pop + IL_0024: nop + IL_0025: br.s IL_0028 + + IL_0027: nop + IL_0028: ldloc.2 + IL_0029: ldloc.0 + IL_002a: bge.un.s IL_0031 + + IL_002c: ldc.i4.0 + IL_002d: conv.i8 + IL_002e: nop + IL_002f: br.s IL_0037 + + IL_0031: ldloc.2 + IL_0032: ldloc.0 + IL_0033: sub + IL_0034: ldloc.1 + IL_0035: div.un + IL_0036: nop + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldc.i4.m1 + IL_003a: conv.i8 + IL_003b: ceq + IL_003d: stloc.s V_4 + IL_003f: ldloc.s V_4 + IL_0041: brfalse.s IL_0075 + + IL_0043: ldc.i4.1 + IL_0044: stloc.s V_6 + IL_0046: ldc.i4.0 + IL_0047: conv.i8 + IL_0048: stloc.s V_7 + IL_004a: ldloc.0 + IL_004b: stloc.s V_8 + IL_004d: br.s IL_006e + + IL_004f: ldloca.s V_5 + IL_0051: ldloc.s V_8 + IL_0053: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0058: nop + IL_0059: ldloc.s V_8 + IL_005b: ldloc.1 + IL_005c: add + IL_005d: stloc.s V_8 + IL_005f: ldloc.s V_7 + IL_0061: ldc.i4.1 + IL_0062: conv.i8 + IL_0063: add + IL_0064: stloc.s V_7 + IL_0066: ldloc.s V_7 + IL_0068: ldc.i4.0 + IL_0069: conv.i8 + IL_006a: cgt.un + IL_006c: stloc.s V_6 + IL_006e: ldloc.s V_6 + IL_0070: brtrue.s IL_004f + + IL_0072: nop + IL_0073: br.s IL_00b0 + + IL_0075: ldloc.2 + IL_0076: ldloc.0 + IL_0077: bge.un.s IL_007e + + IL_0079: ldc.i4.0 + IL_007a: conv.i8 + IL_007b: nop + IL_007c: br.s IL_0087 + + IL_007e: ldloc.2 + IL_007f: ldloc.0 + IL_0080: sub + IL_0081: ldloc.1 + IL_0082: div.un + IL_0083: ldc.i4.1 + IL_0084: conv.i8 + IL_0085: add.ovf.un + IL_0086: nop + IL_0087: stloc.s V_7 + IL_0089: ldc.i4.0 + IL_008a: conv.i8 + IL_008b: stloc.s V_8 + IL_008d: ldloc.0 + IL_008e: stloc.s V_9 + IL_0090: br.s IL_00a9 + + IL_0092: ldloca.s V_5 + IL_0094: ldloc.s V_9 + IL_0096: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_009b: nop + IL_009c: ldloc.s V_9 + IL_009e: ldloc.1 + IL_009f: add + IL_00a0: stloc.s V_9 + IL_00a2: ldloc.s V_8 + IL_00a4: ldc.i4.1 + IL_00a5: conv.i8 + IL_00a6: add + IL_00a7: stloc.s V_8 + IL_00a9: ldloc.s V_8 + IL_00ab: ldloc.s V_7 + IL_00ad: blt.un.s IL_0092 + + IL_00af: nop + IL_00b0: ldloca.s V_5 + IL_00b2: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b7: ret + } + +} + +.class private abstract auto ansi sealed ''.$assembly + extends [runtime]System.Object +{ + .method public static void main@() cil managed + { + .entrypoint + + .maxstack 8 + IL_0000: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepByte.fs new file mode 100644 index 00000000000..f4e047fb3d5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepByte.fs @@ -0,0 +1,57 @@ +let mutable c = 0uy + +let f0 () = + for n in 10uy..1uy do + c <- n + +let f00 () = + for n in 10uy..1uy..1uy do + c <- n + +let f1 () = + for n in 1uy..10uy do + c <- n + +let f2 start = + for n in start..10uy do + c <- n + +let f3 finish = + for n in 1uy..finish do + c <- n + +let f4 (start: byte) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1uy..1uy..10uy do + c <- n + +let f6 () = + for n in 1uy..2uy..10uy do + c <- n + +let f7uy start = + for n in start..2uy..10uy do + c <- n + +let f8 step = + for n in 1uy..step..10uy do + c <- n + +let f9 finish = + for n in 1uy..2uy..finish do + c <- n + +let f10 (start: byte) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0uy..finish do + c <- n + +let f12 () = + for n in 1uy..0uy..10uy do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepByte.fs.opt.il.bsl new file mode 100644 index 00000000000..681c6e38186 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepByte.fs.opt.il.bsl @@ -0,0 +1,674 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7uy(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint8) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(uint8 step) cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u2 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: stloc.1 + IL_001b: ldc.i4.1 + IL_001c: stloc.2 + IL_001d: br.s IL_002d + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint8) + IL_0025: ldloc.2 + IL_0026: ldarg.0 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001f + + IL_0031: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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: ldc.i4.1 + 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.2 + 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 f10(uint8 start, + uint8 step, + uint8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0018 + + IL_0014: ldc.i4.0 + IL_0015: nop + IL_0016: br.s IL_0021 + + IL_0018: ldarg.2 + IL_0019: ldarg.2 + IL_001a: sub + IL_001b: ldarg.1 + IL_001c: div.un + IL_001d: conv.u2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldarg.2 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(uint8) + IL_002e: ldloc.2 + IL_002f: ldarg.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f11(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 5 + .locals init (uint8 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint8) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint8 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint8) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: 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 uint8 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld uint8 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepChar.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepChar.fs new file mode 100644 index 00000000000..137044d13b9 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepChar.fs @@ -0,0 +1,57 @@ +let mutable c = '\000' + +let f0 () = + for n in 'z'..'a' do + c <- n + +let f00 () = + for n in 'z'..'\001'..'a' do + c <- n + +let f1 () = + for n in 'a'..'z' do + c <- n + +let f2 start = + for n in start..'z' do + c <- n + +let f3 finish = + for n in 'a'..finish do + c <- n + +let f4 (start: char) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 'a'..'\001'..'z' do + c <- n + +let f6 () = + for n in 'a'..'\002'..'z' do + c <- n + +let f7 start = + for n in start..'\002'..'z' do + c <- n + +let f8 step = + for n in 'a'..step..'z' do + c <- n + +let f9 finish = + for n in 'a'..'\002'..finish do + c <- n + +let f10 (start: char) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..'\000'..finish do + c <- n + +let f12 () = + for n in 'a'..'\000'..'z' do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepChar.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepChar.fs.opt.il.bsl new file mode 100644 index 00000000000..bb440972d85 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepChar.fs.opt.il.bsl @@ -0,0 +1,850 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 auto ansi serializable sealed nested assembly beforefieldinit f8@40 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f8@40 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f8@40::.ctor() + IL_0005: stsfld class assembly/f8@40 assembly/f8@40::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f10@48 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f10@48 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f10@48::.ctor() + IL_0005: stsfld class assembly/f10@48 assembly/f10@48::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f11@52 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f11@52 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f11@52::.ctor() + IL_0005: stsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f12@56 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f12@56 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f12@56::.ctor() + IL_0005: stsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_000a: ret + } + + } + + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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 13 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 122 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(char step) cil managed + { + + .maxstack 7 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: bne.un.s IL_0018 + + IL_0004: ldc.i4.0 + IL_0005: ldsfld class assembly/f8@40 assembly/f8@40::@_instance + IL_000a: ldc.i4.s 97 + IL_000c: ldarg.0 + IL_000d: ldc.i4.s 122 + IL_000f: 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_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.s 122 + IL_001b: ldc.i4.s 97 + IL_001d: sub + IL_001e: ldarg.0 + IL_001f: div.un + IL_0020: conv.u4 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: stloc.1 + IL_0026: ldc.i4.s 97 + IL_0028: stloc.2 + IL_0029: br.s IL_0039 + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(char) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: ldloc.0 + IL_003b: blt.un.s IL_002b + + IL_003d: ret + } + + .method public static void f9(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_0013 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.s 97 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldc.i4.s 97 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(char) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f10(char start, + char step, + char finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 7 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldc.i4.0 + IL_0002: bne.un.s IL_0016 + + IL_0004: ldc.i4.0 + IL_0005: ldsfld class assembly/f10@48 assembly/f10@48::@_instance + IL_000a: ldarg.2 + IL_000b: ldarg.1 + IL_000c: ldarg.2 + IL_000d: 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_0012: pop + IL_0013: nop + IL_0014: br.s IL_0017 + + IL_0016: nop + IL_0017: ldarg.2 + IL_0018: ldarg.2 + IL_0019: bge.un.s IL_001f + + IL_001b: ldc.i4.0 + IL_001c: nop + IL_001d: br.s IL_0028 + + IL_001f: ldarg.2 + IL_0020: ldarg.2 + IL_0021: sub + IL_0022: ldarg.1 + IL_0023: div.un + IL_0024: conv.u4 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: nop + IL_0028: stloc.0 + IL_0029: ldc.i4.0 + IL_002a: stloc.1 + IL_002b: ldarg.2 + IL_002c: stloc.2 + IL_002d: br.s IL_003d + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(char) + IL_0035: ldloc.2 + IL_0036: ldarg.1 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.1 + IL_003d: ldloc.1 + IL_003e: ldloc.0 + IL_003f: blt.un.s IL_002f + + IL_0041: ret + } + + .method public static void f11(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 7 + .locals init (char V_0, + char V_1, + char V_2) + IL_0000: ldc.i4.0 + IL_0001: ldsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_0006: ldarg.0 + IL_0007: ldc.i4.0 + IL_0008: ldarg.1 + IL_0009: 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_000e: pop + IL_000f: ldc.i4.0 + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(char) + IL_001d: ldloc.2 + IL_001e: ldc.i4.0 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f12() cil managed + { + + .maxstack 7 + .locals init (char V_0, + char V_1, + char V_2) + IL_0000: ldc.i4.0 + IL_0001: ldsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_0006: ldc.i4.s 97 + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.s 122 + IL_000b: 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_0010: pop + IL_0011: ldc.i4.0 + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.s 97 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + IL_0020: ldloc.2 + IL_0021: ldc.i4.0 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: 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 char c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld char ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt16.fs new file mode 100644 index 00000000000..f664f0ad2de --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt16.fs @@ -0,0 +1,65 @@ +let mutable c = 0s + +let f0 () = + for n in 10s..1s do + c <- n + +let f00 () = + for n in 10s..1s..1s do + c <- n + +let f1 () = + for n in 1s..10s do + c <- n + +let f2 start = + for n in start..10s do + c <- n + +let f3 finish = + for n in 1s..finish do + c <- n + +let f4 (start: int16) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1s..1s..10s do + c <- n + +let f6 () = + for n in 1s..2s..10s do + c <- n + +let f7 start = + for n in start..2s..10s do + c <- n + +let f8 step = + for n in 1s..step..10s do + c <- n + +let f9 finish = + for n in 1s..2s..finish do + c <- n + +let f10 (start: int16) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0s..finish do + c <- n + +let f12 () = + for n in 1s..0s..10s do + c <- n + +let f13 () = + for n in 10s .. -1s .. 1s do + c <- n + +let f14 () = + for n in 10s .. -2s .. 1s do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt16.fs.opt.il.bsl new file mode 100644 index 00000000000..79646c5f401 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt16.fs.opt.il.bsl @@ -0,0 +1,767 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.i4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int16) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(int16 step) cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_001f + + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: conv.i4 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: ldc.i4.0 + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldc.i4.1 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(int16) + IL_002e: ldloc.2 + IL_002f: ldarg.0 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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.1 + 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.2 + 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 f10(int16 start, + int16 step, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0027 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: nop + IL_001a: br.s IL_003b + + IL_001c: ldarg.2 + IL_001d: ldarg.2 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: div.un + IL_0021: conv.i4 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: nop + IL_0025: br.s IL_003b + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: nop + IL_002d: br.s IL_003b + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: div.un + IL_0037: conv.i4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: nop + IL_003b: stloc.0 + IL_003c: ldc.i4.0 + IL_003d: stloc.1 + IL_003e: ldarg.2 + IL_003f: stloc.2 + IL_0040: br.s IL_0050 + + IL_0042: ldloc.2 + IL_0043: call void assembly::set_c(int16) + IL_0048: ldloc.2 + IL_0049: ldarg.1 + IL_004a: add + IL_004b: stloc.2 + IL_004c: ldloc.1 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.1 + IL_0050: ldloc.1 + IL_0051: ldloc.0 + IL_0052: blt.un.s IL_0042 + + IL_0054: ret + } + + .method public static void f11(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 5 + .locals init (int16 V_0, + int16 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int16) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int16 V_0, + int16 V_1, + int16 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int16) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret + } + + .method public static void f13() 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 f14() 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_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.s -2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: blt.un.s IL_0007 + + IL_001a: 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 int16 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld int16 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt32.fs new file mode 100644 index 00000000000..32bca951da3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt32.fs @@ -0,0 +1,65 @@ +let mutable c = 0 + +let f0 () = + for n in 10..1 do + c <- n + +let f00 () = + for n in 10..1..1 do + c <- n + +let f1 () = + for n in 1..10 do + c <- n + +let f2 start = + for n in start..10 do + c <- n + +let f3 finish = + for n in 1..finish do + c <- n + +let f4 start finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1..1..10 do + c <- n + +let f6 () = + for n in 1..2..10 do + c <- n + +let f7 start = + for n in start..2..10 do + c <- n + +let f8 step = + for n in 1..step..10 do + c <- n + +let f9 finish = + for n in 1..2..finish do + c <- n + +let f10 start step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0..finish do + c <- n + +let f12 () = + for n in 1..0..10 do + c <- n + +let f13 () = + for n in 10..-1..1 do + c <- n + +let f14 () = + for n in 10..-2..1 do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt32.fs.opt.il.bsl new file mode 100644 index 00000000000..e511f90098b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt32.fs.opt.il.bsl @@ -0,0 +1,725 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .method public specialname static int32 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int32 ''.$assembly::c@1 + 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@1 + IL_0006: ret + } + + .method public static void f0() 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 f00() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 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(int32) + 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 f1() 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 f2(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 f3(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 f4(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 f5() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 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(int32) + 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 f6() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 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(int32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.2 + 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.5 + IL_0018: conv.i8 + IL_0019: blt.un.s IL_0007 + + IL_001b: ret + } + + .method public static void f7(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0015 + + IL_000a: ldc.i4.s 10 + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: div.un + IL_0010: conv.i8 + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldarg.0 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(int32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + 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_001d + + IL_0030: ret + } + + .method public static void f8(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_0020 + + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: conv.i8 + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: add + IL_001d: nop + IL_001e: br.s IL_0023 + + IL_0020: ldc.i4.0 + IL_0021: conv.i8 + IL_0022: nop + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: stloc.1 + IL_0027: ldc.i4.1 + IL_0028: stloc.2 + IL_0029: br.s IL_003a + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(int32) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002b + + IL_003e: ret + } + + .method public static void f9(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0013 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: ldc.i4.2 + IL_000d: div.un + IL_000e: conv.i8 + 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: ldc.i4.1 + IL_0018: stloc.2 + IL_0019: br.s IL_002a + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int32) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + 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 f10(!!a start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0029 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001d + + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: nop + IL_001b: br.s IL_003f + + IL_001d: ldarg.2 + IL_001e: ldarg.2 + IL_001f: sub + IL_0020: ldarg.1 + IL_0021: div.un + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: nop + IL_0027: br.s IL_003f + + IL_0029: ldarg.2 + IL_002a: ldarg.2 + IL_002b: bge.s IL_0032 + + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: nop + IL_0030: br.s IL_003f + + IL_0032: ldarg.2 + IL_0033: ldarg.2 + IL_0034: sub + IL_0035: ldarg.1 + IL_0036: not + IL_0037: ldc.i4.1 + IL_0038: add + IL_0039: div.un + IL_003a: conv.i8 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: nop + IL_003f: stloc.0 + IL_0040: ldc.i4.0 + IL_0041: conv.i8 + IL_0042: stloc.1 + IL_0043: ldarg.2 + IL_0044: stloc.2 + IL_0045: br.s IL_0056 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(int32) + IL_004d: ldloc.2 + IL_004e: ldarg.1 + IL_004f: add + IL_0050: stloc.2 + IL_0051: ldloc.1 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.1 + IL_0056: ldloc.1 + IL_0057: ldloc.0 + IL_0058: blt.un.s IL_0047 + + IL_005a: ret + } + + .method public static void f11(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, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int32) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int32) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.1 + IL_0006: br.s IL_0017 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.m1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add + IL_0016: stloc.0 + IL_0017: ldloc.0 + IL_0018: ldc.i4.s 10 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f14() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.s -2 + 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.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: 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 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld int32 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs new file mode 100644 index 00000000000..9e272eb300a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs @@ -0,0 +1,65 @@ +let mutable c = 0L + +let f0 () = + for n in 10L..1L do + c <- n + +let f00 () = + for n in 10L..1L..1L do + c <- n + +let f1 () = + for n in 1L..10L do + c <- n + +let f2 start = + for n in start..10L do + c <- n + +let f3 finish = + for n in 1L..finish do + c <- n + +let f4 (start: int64) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1L..1L..10L do + c <- n + +let f6 () = + for n in 1L..2L..10L do + c <- n + +let f7 start = + for n in start..2L..10L do + c <- n + +let f8 step = + for n in 1L..step..10L do + c <- n + +let f9 finish = + for n in 1L..2L..finish do + c <- n + +let f10 (start: int64) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0L..finish do + c <- n + +let f12 () = + for n in 1L..0L..10L do + c <- n + +let f13 () = + for n in 10L.. -1L ..1L do + c <- n + +let f14 () = + for n in 10L.. -2L ..1L do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl new file mode 100644 index 00000000000..0f20def3e61 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepInt64.fs.opt.il.bsl @@ -0,0 +1,993 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f7(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_0017 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(int64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret + } + + .method public static void f8(int64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 + + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: ldarg.0 + IL_0016: bge.s IL_0023 + + IL_0018: ldc.i4.s 9 + IL_001a: conv.i8 + IL_001b: ldarg.0 + IL_001c: div.un + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add.ovf.un + IL_0020: nop + IL_0021: br.s IL_0026 + + IL_0023: ldc.i4.0 + IL_0024: conv.i8 + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: br.s IL_003e + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(int64) + IL_0035: ldloc.2 + IL_0036: ldarg.0 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.1 + IL_003e: ldloc.1 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ret + } + + .method public static void f9(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_0015 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + 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.2 + 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 f10(int64 start, + int64 step, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: ldarg.1 + IL_0013: bge.s IL_0026 + + IL_0015: ldarg.2 + IL_0016: ldarg.2 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0039 + + IL_001e: ldarg.2 + IL_001f: ldarg.2 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: nop + IL_0024: br.s IL_0039 + + IL_0026: ldarg.2 + IL_0027: ldarg.2 + IL_0028: bge.s IL_002f + + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: nop + IL_002d: br.s IL_0039 + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: add + IL_0037: div.un + IL_0038: nop + IL_0039: stloc.0 + IL_003a: ldloc.0 + IL_003b: ldc.i4.m1 + IL_003c: conv.i8 + IL_003d: bne.un.s IL_0061 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.2 + IL_0045: stloc.3 + IL_0046: br.s IL_005d + + IL_0048: ldloc.3 + IL_0049: call void assembly::set_c(int64) + IL_004e: ldloc.3 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.2 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.2 + IL_0057: ldloc.2 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: cgt.un + IL_005c: stloc.1 + IL_005d: ldloc.1 + IL_005e: brtrue.s IL_0048 + + IL_0060: ret + + IL_0061: ldc.i4.0 + IL_0062: conv.i8 + IL_0063: ldarg.1 + IL_0064: bge.s IL_007a + + IL_0066: ldarg.2 + IL_0067: ldarg.2 + IL_0068: bge.s IL_006f + + IL_006a: ldc.i4.0 + IL_006b: conv.i8 + IL_006c: nop + IL_006d: br.s IL_0090 + + IL_006f: ldarg.2 + IL_0070: ldarg.2 + IL_0071: sub + IL_0072: ldarg.1 + IL_0073: div.un + IL_0074: ldc.i4.1 + IL_0075: conv.i8 + IL_0076: add.ovf.un + IL_0077: nop + IL_0078: br.s IL_0090 + + IL_007a: ldarg.2 + IL_007b: ldarg.2 + IL_007c: bge.s IL_0083 + + IL_007e: ldc.i4.0 + IL_007f: conv.i8 + IL_0080: nop + IL_0081: br.s IL_0090 + + IL_0083: ldarg.2 + IL_0084: ldarg.2 + IL_0085: sub + IL_0086: ldarg.1 + IL_0087: not + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: div.un + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add.ovf.un + IL_008f: nop + IL_0090: stloc.2 + IL_0091: ldc.i4.0 + IL_0092: conv.i8 + IL_0093: stloc.s V_4 + IL_0095: ldarg.2 + IL_0096: stloc.3 + IL_0097: br.s IL_00aa + + IL_0099: ldloc.3 + IL_009a: call void assembly::set_c(int64) + IL_009f: ldloc.3 + IL_00a0: ldarg.1 + IL_00a1: add + IL_00a2: stloc.3 + IL_00a3: ldloc.s V_4 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_4 + IL_00aa: ldloc.s V_4 + IL_00ac: ldloc.2 + IL_00ad: blt.un.s IL_0099 + + IL_00af: ret + } + + .method public static void f11(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 5 + .locals init (int64 V_0, + int64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldarg.0 + IL_0011: stloc.2 + IL_0012: br.s IL_0024 + + IL_0014: ldloc.2 + IL_0015: call void assembly::set_c(int64) + IL_001a: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.2 + IL_001f: ldloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0014 + + IL_0028: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int64 V_0, + int64 V_1, + int64 V_2) + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 + IL_0003: conv.i8 + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000c: pop + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: br.s IL_0028 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + 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_0018 + + IL_002c: ret + } + + .method public static void f13() 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 f14() 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_001a + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.s -2 + IL_0012: conv.i8 + IL_0013: add + IL_0014: stloc.1 + IL_0015: ldloc.0 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldloc.0 + IL_001b: ldc.i4.5 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0009 + + IL_001f: 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 int64 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stsfld int64 ''.$assembly::c@1 + IL_0007: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs new file mode 100644 index 00000000000..31464a36932 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs @@ -0,0 +1,65 @@ +let mutable c = 0n + +let f0 () = + for n in 10n..1n do + c <- n + +let f00 () = + for n in 10n..1n..1n do + c <- n + +let f1 () = + for n in 1n..10n do + c <- n + +let f2 start = + for n in start..10n do + c <- n + +let f3 finish = + for n in 1n..finish do + c <- n + +let f4 (start: nativeint) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1n..1n..10n do + c <- n + +let f6 () = + for n in 1n..2n..10n do + c <- n + +let f7 start = + for n in start..2n..10n do + c <- n + +let f8 step = + for n in 1n..step..10n do + c <- n + +let f9 finish = + for n in 1n..2n..finish do + c <- n + +let f10 (start: nativeint) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0n..finish do + c <- n + +let f12 () = + for n in 1n..0n..10n do + c <- n + +let f13 () = + for n in 10n.. -1n ..1n do + c <- n + +let f14 () = + for n in 10n.. -2n ..1n do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl new file mode 100644 index 00000000000..330c21deb58 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -0,0 +1,1571 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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 0x2 + 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 0x5 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f7(native int start) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2) + 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_003d + + IL_001a: ldc.i8 0xa + IL_0023: conv.i + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.i + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.i + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: stloc.1 + IL_0049: ldarg.0 + IL_004a: stloc.2 + IL_004b: br.s IL_006d + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(native int) + IL_0053: ldloc.2 + IL_0054: ldc.i8 0x2 + IL_005d: conv.i + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.1 + IL_0061: ldc.i8 0x1 + IL_006a: conv.i + IL_006b: add + IL_006c: stloc.1 + IL_006d: ldloc.1 + IL_006e: ldloc.0 + IL_006f: blt.un.s IL_004d + + IL_0071: ret + } + + .method public static void f8(native int step) cil managed + { + + .maxstack 5 + .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 0x0 + IL_000a: conv.i + IL_000b: bne.un.s IL_002b + + IL_000d: ldc.i8 0x1 + IL_0016: conv.i + IL_0017: ldarg.0 + IL_0018: ldc.i8 0xa + IL_0021: conv.i + IL_0022: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0027: pop + IL_0028: nop + IL_0029: br.s IL_002c + + IL_002b: nop + IL_002c: ldc.i8 0x0 + IL_0035: conv.i + IL_0036: ldarg.0 + IL_0037: bge.s IL_0076 + + IL_0039: ldc.i8 0xa + IL_0042: conv.i + IL_0043: ldc.i8 0x1 + IL_004c: conv.i + IL_004d: bge.s IL_005c + + IL_004f: ldc.i8 0x0 + IL_0058: conv.i + IL_0059: nop + IL_005a: br.s IL_00bd + + IL_005c: ldc.i8 0xa + IL_0065: conv.i + IL_0066: ldc.i8 0x1 + IL_006f: conv.i + IL_0070: sub + IL_0071: ldarg.0 + IL_0072: div.un + IL_0073: nop + IL_0074: br.s IL_00bd + + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: ldc.i8 0xa + IL_0089: conv.i + IL_008a: bge.s IL_0099 + + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: nop + IL_0097: br.s IL_00bd + + IL_0099: ldc.i8 0x1 + IL_00a2: conv.i + IL_00a3: ldc.i8 0xa + IL_00ac: conv.i + IL_00ad: sub + IL_00ae: ldarg.0 + IL_00af: not + IL_00b0: ldc.i8 0x1 + IL_00b9: conv.i + IL_00ba: add + IL_00bb: div.un + IL_00bc: nop + IL_00bd: stloc.0 + IL_00be: sizeof [runtime]System.IntPtr + IL_00c4: ldc.i4.4 + IL_00c5: bne.un.s IL_00d7 + + IL_00c7: ldloc.0 + IL_00c8: ldc.i8 0xffffffff + IL_00d1: conv.u + IL_00d2: ceq + IL_00d4: nop + IL_00d5: br.s IL_00e5 + + IL_00d7: ldloc.0 + IL_00d8: ldc.i8 0xffffffffffffffff + IL_00e1: conv.u + IL_00e2: ceq + IL_00e4: nop + IL_00e5: brfalse.s IL_012a + + IL_00e7: ldc.i4.1 + IL_00e8: stloc.1 + IL_00e9: ldc.i8 0x0 + IL_00f2: conv.i + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x1 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: br.s IL_0126 + + IL_0101: ldloc.3 + IL_0102: call void assembly::set_c(native int) + IL_0107: ldloc.3 + IL_0108: ldarg.0 + IL_0109: add + IL_010a: stloc.3 + IL_010b: ldloc.2 + IL_010c: ldc.i8 0x1 + IL_0115: conv.i + IL_0116: add + IL_0117: stloc.2 + IL_0118: ldloc.2 + IL_0119: ldc.i8 0x0 + IL_0122: conv.i + IL_0123: cgt.un + IL_0125: stloc.1 + IL_0126: ldloc.1 + IL_0127: brtrue.s IL_0101 + + IL_0129: ret + + IL_012a: ldc.i8 0x0 + IL_0133: conv.i + IL_0134: ldarg.0 + IL_0135: bge.s IL_0182 + + IL_0137: ldc.i8 0xa + IL_0140: conv.i + IL_0141: ldc.i8 0x1 + IL_014a: conv.i + IL_014b: bge.s IL_015d + + IL_014d: ldc.i8 0x0 + IL_0156: conv.i + IL_0157: nop + IL_0158: br IL_01d4 + + IL_015d: ldc.i8 0xa + IL_0166: conv.i + IL_0167: ldc.i8 0x1 + IL_0170: conv.i + IL_0171: sub + IL_0172: ldarg.0 + IL_0173: div.un + IL_0174: ldc.i8 0x1 + IL_017d: conv.i + IL_017e: add.ovf.un + IL_017f: nop + IL_0180: br.s IL_01d4 + + IL_0182: ldc.i8 0x1 + IL_018b: conv.i + IL_018c: ldc.i8 0xa + IL_0195: conv.i + IL_0196: bge.s IL_01a5 + + IL_0198: ldc.i8 0x0 + IL_01a1: conv.i + IL_01a2: nop + IL_01a3: br.s IL_01d4 + + IL_01a5: ldc.i8 0x1 + IL_01ae: conv.i + IL_01af: ldc.i8 0xa + IL_01b8: conv.i + IL_01b9: sub + IL_01ba: ldarg.0 + IL_01bb: not + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add + IL_01c7: div.un + IL_01c8: ldc.i8 0x1 + IL_01d1: conv.i + IL_01d2: add.ovf.un + IL_01d3: nop + IL_01d4: stloc.2 + IL_01d5: ldc.i8 0x0 + IL_01de: conv.i + IL_01df: stloc.3 + IL_01e0: ldc.i8 0x1 + IL_01e9: conv.i + IL_01ea: stloc.s V_4 + IL_01ec: br.s IL_0208 + + IL_01ee: ldloc.s V_4 + IL_01f0: call void assembly::set_c(native int) + IL_01f5: ldloc.s V_4 + IL_01f7: ldarg.0 + IL_01f8: add + IL_01f9: stloc.s V_4 + IL_01fb: ldloc.3 + IL_01fc: ldc.i8 0x1 + IL_0205: conv.i + IL_0206: add + IL_0207: stloc.3 + IL_0208: ldloc.3 + IL_0209: ldloc.2 + IL_020a: blt.un.s IL_01ee + + IL_020c: ret + } + + .method public static void f9(native int finish) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2) + 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_003d + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.i + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.i + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.i + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: stloc.1 + IL_0049: ldc.i8 0x1 + IL_0052: conv.i + IL_0053: stloc.2 + IL_0054: br.s IL_0076 + + IL_0056: ldloc.2 + IL_0057: call void assembly::set_c(native int) + IL_005c: ldloc.2 + IL_005d: ldc.i8 0x2 + IL_0066: conv.i + IL_0067: add + IL_0068: stloc.2 + IL_0069: ldloc.1 + IL_006a: ldc.i8 0x1 + IL_0073: conv.i + IL_0074: add + IL_0075: stloc.1 + IL_0076: ldloc.1 + IL_0077: ldloc.0 + IL_0078: blt.un.s IL_0056 + + IL_007a: ret + } + + .method public static void f10(native int start, + native int step, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .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: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: bne.un.s IL_0019 + + IL_000d: ldarg.2 + IL_000e: ldarg.1 + IL_000f: ldarg.2 + IL_0010: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0015: pop + IL_0016: nop + IL_0017: br.s IL_001a + + IL_0019: nop + IL_001a: ldc.i8 0x0 + IL_0023: conv.i + IL_0024: ldarg.1 + IL_0025: bge.s IL_0040 + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_0038 + + IL_002b: ldc.i8 0x0 + IL_0034: conv.i + IL_0035: nop + IL_0036: br.s IL_0063 + + IL_0038: ldarg.2 + IL_0039: ldarg.2 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: div.un + IL_003d: nop + IL_003e: br.s IL_0063 + + IL_0040: ldarg.2 + IL_0041: ldarg.2 + IL_0042: bge.s IL_0051 + + IL_0044: ldc.i8 0x0 + IL_004d: conv.i + IL_004e: nop + IL_004f: br.s IL_0063 + + IL_0051: ldarg.2 + IL_0052: ldarg.2 + IL_0053: sub + IL_0054: ldarg.1 + IL_0055: not + IL_0056: ldc.i8 0x1 + IL_005f: conv.i + IL_0060: add + IL_0061: div.un + IL_0062: nop + IL_0063: stloc.0 + IL_0064: sizeof [runtime]System.IntPtr + IL_006a: ldc.i4.4 + IL_006b: bne.un.s IL_007d + + IL_006d: ldloc.0 + IL_006e: ldc.i8 0xffffffff + IL_0077: conv.u + IL_0078: ceq + IL_007a: nop + IL_007b: br.s IL_008b + + IL_007d: ldloc.0 + IL_007e: ldc.i8 0xffffffffffffffff + IL_0087: conv.u + IL_0088: ceq + IL_008a: nop + IL_008b: brfalse.s IL_00c7 + + IL_008d: ldc.i4.1 + IL_008e: stloc.1 + IL_008f: ldc.i8 0x0 + IL_0098: conv.i + IL_0099: stloc.2 + IL_009a: ldarg.2 + IL_009b: stloc.3 + IL_009c: br.s IL_00c3 + + IL_009e: ldloc.3 + IL_009f: call void assembly::set_c(native int) + IL_00a4: ldloc.3 + IL_00a5: ldarg.1 + IL_00a6: add + IL_00a7: stloc.3 + IL_00a8: ldloc.2 + IL_00a9: ldc.i8 0x1 + IL_00b2: conv.i + IL_00b3: add + IL_00b4: stloc.2 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x0 + IL_00bf: conv.i + IL_00c0: cgt.un + IL_00c2: stloc.1 + IL_00c3: ldloc.1 + IL_00c4: brtrue.s IL_009e + + IL_00c6: ret + + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: ldarg.1 + IL_00d2: bge.s IL_00f8 + + IL_00d4: ldarg.2 + IL_00d5: ldarg.2 + IL_00d6: bge.s IL_00e5 + + IL_00d8: ldc.i8 0x0 + IL_00e1: conv.i + IL_00e2: nop + IL_00e3: br.s IL_0126 + + IL_00e5: ldarg.2 + IL_00e6: ldarg.2 + IL_00e7: sub + IL_00e8: ldarg.1 + IL_00e9: div.un + IL_00ea: ldc.i8 0x1 + IL_00f3: conv.i + IL_00f4: add.ovf.un + IL_00f5: nop + IL_00f6: br.s IL_0126 + + IL_00f8: ldarg.2 + IL_00f9: ldarg.2 + IL_00fa: bge.s IL_0109 + + IL_00fc: ldc.i8 0x0 + IL_0105: conv.i + IL_0106: nop + IL_0107: br.s IL_0126 + + IL_0109: ldarg.2 + IL_010a: ldarg.2 + IL_010b: sub + IL_010c: ldarg.1 + IL_010d: not + IL_010e: ldc.i8 0x1 + IL_0117: conv.i + IL_0118: add + IL_0119: div.un + IL_011a: ldc.i8 0x1 + IL_0123: conv.i + IL_0124: add.ovf.un + IL_0125: nop + IL_0126: stloc.2 + IL_0127: ldc.i8 0x0 + IL_0130: conv.i + IL_0131: stloc.3 + IL_0132: ldarg.2 + IL_0133: stloc.s V_4 + IL_0135: br.s IL_0151 + + IL_0137: ldloc.s V_4 + IL_0139: call void assembly::set_c(native int) + IL_013e: ldloc.s V_4 + IL_0140: ldarg.1 + IL_0141: add + IL_0142: stloc.s V_4 + IL_0144: ldloc.3 + IL_0145: ldc.i8 0x1 + IL_014e: conv.i + IL_014f: add + IL_0150: stloc.3 + IL_0151: ldloc.3 + IL_0152: ldloc.2 + IL_0153: blt.un.s IL_0137 + + IL_0155: ret + } + + .method public static void f11(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 5 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0011: pop + IL_0012: ldc.i8 0x0 + IL_001b: conv.i + IL_001c: stloc.0 + IL_001d: ldc.i8 0x0 + IL_0026: conv.i + IL_0027: stloc.1 + IL_0028: ldarg.0 + IL_0029: stloc.2 + IL_002a: br.s IL_004c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(native int) + IL_0032: ldloc.2 + IL_0033: ldc.i8 0x0 + IL_003c: conv.i + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i8 0x1 + IL_0049: conv.i + IL_004a: add + IL_004b: stloc.1 + IL_004c: ldloc.1 + IL_004d: ldloc.0 + IL_004e: blt.un.s IL_002c + + IL_0050: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldc.i8 0x1 + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: ldc.i8 0xa + IL_001d: conv.i + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0023: pop + IL_0024: ldc.i8 0x0 + IL_002d: conv.i + IL_002e: stloc.0 + IL_002f: ldc.i8 0x0 + IL_0038: conv.i + IL_0039: stloc.1 + IL_003a: ldc.i8 0x1 + IL_0043: conv.i + IL_0044: stloc.2 + IL_0045: br.s IL_0067 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(native int) + IL_004d: ldloc.2 + IL_004e: ldc.i8 0x0 + IL_0057: conv.i + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.1 + IL_005b: ldc.i8 0x1 + IL_0064: conv.i + IL_0065: add + IL_0066: stloc.1 + IL_0067: ldloc.1 + IL_0068: ldloc.0 + IL_0069: blt.un.s IL_0047 + + IL_006b: ret + } + + .method public static void f13() 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 f14() cil managed + { + + .maxstack 5 + .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 0xfffffffffffffffe + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: bne.un.s IL_003d + + IL_0016: ldc.i8 0xa + IL_001f: conv.i + IL_0020: ldc.i8 0xfffffffffffffffe + IL_0029: conv.i + IL_002a: ldc.i8 0x1 + IL_0033: conv.i + IL_0034: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0039: pop + IL_003a: nop + IL_003b: br.s IL_003e + + IL_003d: nop + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: ldc.i8 0xfffffffffffffffe + IL_0051: conv.i + IL_0052: bge.s IL_009a + + IL_0054: ldc.i8 0x1 + IL_005d: conv.i + IL_005e: ldc.i8 0xa + IL_0067: conv.i + IL_0068: bge.s IL_0077 + + IL_006a: ldc.i8 0x0 + IL_0073: conv.i + IL_0074: nop + IL_0075: br.s IL_00ea + + IL_0077: ldc.i8 0x1 + IL_0080: conv.i + IL_0081: ldc.i8 0xa + IL_008a: conv.i + IL_008b: sub + IL_008c: ldc.i8 0xfffffffffffffffe + IL_0095: conv.i + IL_0096: div.un + IL_0097: nop + IL_0098: br.s IL_00ea + + IL_009a: ldc.i8 0xa + IL_00a3: conv.i + IL_00a4: ldc.i8 0x1 + IL_00ad: conv.i + IL_00ae: bge.s IL_00bd + + IL_00b0: ldc.i8 0x0 + IL_00b9: conv.i + IL_00ba: nop + IL_00bb: br.s IL_00ea + + IL_00bd: ldc.i8 0xa + IL_00c6: conv.i + IL_00c7: ldc.i8 0x1 + IL_00d0: conv.i + IL_00d1: sub + IL_00d2: ldc.i8 0xfffffffffffffffe + IL_00db: conv.i + IL_00dc: not + IL_00dd: ldc.i8 0x1 + IL_00e6: conv.i + IL_00e7: add + IL_00e8: div.un + IL_00e9: nop + IL_00ea: stloc.0 + IL_00eb: sizeof [runtime]System.IntPtr + IL_00f1: ldc.i4.4 + IL_00f2: bne.un.s IL_0104 + + IL_00f4: ldloc.0 + IL_00f5: ldc.i8 0xffffffff + IL_00fe: conv.u + IL_00ff: ceq + IL_0101: nop + IL_0102: br.s IL_0112 + + IL_0104: ldloc.0 + IL_0105: ldc.i8 0xffffffffffffffff + IL_010e: conv.u + IL_010f: ceq + IL_0111: nop + IL_0112: brfalse.s IL_0160 + + IL_0114: ldc.i4.1 + IL_0115: stloc.1 + IL_0116: ldc.i8 0x0 + IL_011f: conv.i + IL_0120: stloc.2 + IL_0121: ldc.i8 0xa + IL_012a: conv.i + IL_012b: stloc.3 + IL_012c: br.s IL_015c + + IL_012e: ldloc.3 + IL_012f: call void assembly::set_c(native int) + IL_0134: ldloc.3 + IL_0135: ldc.i8 0xfffffffffffffffe + IL_013e: conv.i + IL_013f: add + IL_0140: stloc.3 + IL_0141: ldloc.2 + IL_0142: ldc.i8 0x1 + IL_014b: conv.i + IL_014c: add + IL_014d: stloc.2 + IL_014e: ldloc.2 + IL_014f: ldc.i8 0x0 + IL_0158: conv.i + IL_0159: cgt.un + IL_015b: stloc.1 + IL_015c: ldloc.1 + IL_015d: brtrue.s IL_012e + + IL_015f: ret + + IL_0160: ldc.i8 0x0 + IL_0169: conv.i + IL_016a: ldc.i8 0xfffffffffffffffe + IL_0173: conv.i + IL_0174: bge.s IL_01ca + + IL_0176: ldc.i8 0x1 + IL_017f: conv.i + IL_0180: ldc.i8 0xa + IL_0189: conv.i + IL_018a: bge.s IL_019c + + IL_018c: ldc.i8 0x0 + IL_0195: conv.i + IL_0196: nop + IL_0197: br IL_0225 + + IL_019c: ldc.i8 0x1 + IL_01a5: conv.i + IL_01a6: ldc.i8 0xa + IL_01af: conv.i + IL_01b0: sub + IL_01b1: ldc.i8 0xfffffffffffffffe + IL_01ba: conv.i + IL_01bb: div.un + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add.ovf.un + IL_01c7: nop + IL_01c8: br.s IL_0225 + + IL_01ca: ldc.i8 0xa + IL_01d3: conv.i + IL_01d4: ldc.i8 0x1 + IL_01dd: conv.i + IL_01de: bge.s IL_01ed + + IL_01e0: ldc.i8 0x0 + IL_01e9: conv.i + IL_01ea: nop + IL_01eb: br.s IL_0225 + + IL_01ed: ldc.i8 0xa + IL_01f6: conv.i + IL_01f7: ldc.i8 0x1 + IL_0200: conv.i + IL_0201: sub + IL_0202: ldc.i8 0xfffffffffffffffe + IL_020b: conv.i + IL_020c: not + IL_020d: ldc.i8 0x1 + IL_0216: conv.i + IL_0217: add + IL_0218: div.un + IL_0219: ldc.i8 0x1 + IL_0222: conv.i + IL_0223: add.ovf.un + IL_0224: nop + IL_0225: stloc.2 + IL_0226: ldc.i8 0x0 + IL_022f: conv.i + IL_0230: stloc.3 + IL_0231: ldc.i8 0xa + IL_023a: conv.i + IL_023b: stloc.s V_4 + IL_023d: br.s IL_0262 + + IL_023f: ldloc.s V_4 + IL_0241: call void assembly::set_c(native int) + IL_0246: ldloc.s V_4 + IL_0248: ldc.i8 0xfffffffffffffffe + IL_0251: conv.i + IL_0252: add + IL_0253: stloc.s V_4 + IL_0255: ldloc.3 + IL_0256: ldc.i8 0x1 + IL_025f: conv.i + IL_0260: add + IL_0261: stloc.3 + IL_0262: ldloc.3 + IL_0263: ldloc.2 + IL_0264: blt.un.s IL_023f + + IL_0266: 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 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 ) + .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: ldc.i8 0x0 + IL_0009: conv.i + IL_000a: stsfld native int ''.$assembly::c@1 + IL_000f: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepSByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepSByte.fs new file mode 100644 index 00000000000..ee96ee45237 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepSByte.fs @@ -0,0 +1,65 @@ +let mutable c = 0y + +let f0 () = + for n in 10y..1y do + c <- n + +let f00 () = + for n in 10y..1y..1y do + c <- n + +let f1 () = + for n in 1y..10y do + c <- n + +let f2 start = + for n in start..10y do + c <- n + +let f3 finish = + for n in 1y..finish do + c <- n + +let f4 (start: sbyte) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1y..1y..10y do + c <- n + +let f6 () = + for n in 1y..2y..10y do + c <- n + +let f7 start = + for n in start..2y..10y do + c <- n + +let f8 step = + for n in 1y..step..10y do + c <- n + +let f9 finish = + for n in 1y..2y..finish do + c <- n + +let f10 (start: sbyte) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0y..finish do + c <- n + +let f12 () = + for n in 1y..0y..10y do + c <- n + +let f13 () = + for n in 10y .. -1y .. 1y do + c <- n + +let f14 () = + for n in 10y .. -2y .. 1y do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepSByte.fs.opt.il.bsl new file mode 100644 index 00000000000..f49d7ac9c52 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepSByte.fs.opt.il.bsl @@ -0,0 +1,767 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.i2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int8) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(int8 step) cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_001f + + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: conv.i2 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: ldc.i4.0 + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldc.i4.1 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(int8) + IL_002e: ldloc.2 + IL_002f: ldarg.0 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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.1 + 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.2 + 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 f10(int8 start, + int8 step, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0027 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: nop + IL_001a: br.s IL_003b + + IL_001c: ldarg.2 + IL_001d: ldarg.2 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: div.un + IL_0021: conv.i2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: nop + IL_0025: br.s IL_003b + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: nop + IL_002d: br.s IL_003b + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: div.un + IL_0037: conv.i2 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: nop + IL_003b: stloc.0 + IL_003c: ldc.i4.0 + IL_003d: stloc.1 + IL_003e: ldarg.2 + IL_003f: stloc.2 + IL_0040: br.s IL_0050 + + IL_0042: ldloc.2 + IL_0043: call void assembly::set_c(int8) + IL_0048: ldloc.2 + IL_0049: ldarg.1 + IL_004a: add + IL_004b: stloc.2 + IL_004c: ldloc.1 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.1 + IL_0050: ldloc.1 + IL_0051: ldloc.0 + IL_0052: blt.un.s IL_0042 + + IL_0054: ret + } + + .method public static void f11(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 5 + .locals init (int8 V_0, + int8 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int8) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int8 V_0, + int8 V_1, + int8 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int8) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret + } + + .method public static void f13() 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 f14() 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_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.s -2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: blt.un.s IL_0007 + + IL_001a: 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 int8 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld int8 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt16.fs new file mode 100644 index 00000000000..64028b65394 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt16.fs @@ -0,0 +1,57 @@ +let mutable c = 0us + +let f0 () = + for n in 10us..1us do + c <- n + +let f00 () = + for n in 10us..1us..1us do + c <- n + +let f1 () = + for n in 1us..10us do + c <- n + +let f2 start = + for n in start..10us do + c <- n + +let f3 finish = + for n in 1us..finish do + c <- n + +let f4 (start: uint16) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1us..1us..10us do + c <- n + +let f6 () = + for n in 1us..2us..10us do + c <- n + +let f7 start = + for n in start..2us..10us do + c <- n + +let f8 step = + for n in 1us..step..10us do + c <- n + +let f9 finish = + for n in 1us..2us..finish do + c <- n + +let f10 (start: uint16) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0us..finish do + c <- n + +let f12 () = + for n in 1us..0us..10us do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt16.fs.opt.il.bsl new file mode 100644 index 00000000000..2b059e5df41 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt16.fs.opt.il.bsl @@ -0,0 +1,674 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint16) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(uint16 step) cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u4 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: stloc.1 + IL_001b: ldc.i4.1 + IL_001c: stloc.2 + IL_001d: br.s IL_002d + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint16) + IL_0025: ldloc.2 + IL_0026: ldarg.0 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001f + + IL_0031: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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.1 + 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.2 + 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 f10(uint16 start, + uint16 step, + uint16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0018 + + IL_0014: ldc.i4.0 + IL_0015: nop + IL_0016: br.s IL_0021 + + IL_0018: ldarg.2 + IL_0019: ldarg.2 + IL_001a: sub + IL_001b: ldarg.1 + IL_001c: div.un + IL_001d: conv.u4 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldarg.2 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(uint16) + IL_002e: ldloc.2 + IL_002f: ldarg.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f11(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 5 + .locals init (uint16 V_0, + uint16 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint16) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint16 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint16) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: 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 uint16 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld uint16 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt32.fs new file mode 100644 index 00000000000..d689d8d393a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt32.fs @@ -0,0 +1,57 @@ +let mutable c = 0u + +let f0 () = + for n in 10u..1u do + c <- n + +let f00 () = + for n in 10u..1u..1u do + c <- n + +let f1 () = + for n in 1u..10u do + c <- n + +let f2 start = + for n in start..10u do + c <- n + +let f3 finish = + for n in 1u..finish do + c <- n + +let f4 (start: uint32) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1u..1u..10u do + c <- n + +let f6 () = + for n in 1u..2u..10u do + c <- n + +let f7 start = + for n in start..2u..10u do + c <- n + +let f8 step = + for n in 1u..step..10u do + c <- n + +let f9 finish = + for n in 1u..2u..finish do + c <- n + +let f10 (start: uint32) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0u..finish do + c <- n + +let f12 () = + for n in 1u..0u..10u do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt32.fs.opt.il.bsl new file mode 100644 index 00000000000..8bf808cab23 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt32.fs.opt.il.bsl @@ -0,0 +1,710 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0018: conv.i8 + IL_0019: blt.un.s IL_0007 + + IL_001b: ret + } + + .method public static void f7(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_0015 + + IL_000a: ldc.i4.s 10 + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: div.un + IL_0010: conv.u8 + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldarg.0 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(uint32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + 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_001d + + IL_0030: ret + } + + .method public static void f8(uint32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u8 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.1 + IL_001d: ldc.i4.1 + IL_001e: stloc.2 + IL_001f: br.s IL_0030 + + IL_0021: ldloc.2 + IL_0022: call void assembly::set_c(uint32) + IL_0027: ldloc.2 + IL_0028: ldarg.0 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.1 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_0021 + + IL_0034: ret + } + + .method public static void f9(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_0013 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: ldc.i4.2 + IL_000d: div.un + 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: ldc.i4.1 + 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.2 + 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 f10(uint32 start, + uint32 step, + uint32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0023 + + IL_0019: ldarg.2 + IL_001a: ldarg.2 + IL_001b: sub + IL_001c: ldarg.1 + IL_001d: div.un + IL_001e: conv.u8 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: add + IL_0022: nop + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: stloc.1 + IL_0027: ldarg.2 + IL_0028: stloc.2 + IL_0029: br.s IL_003a + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(uint32) + IL_0031: ldloc.2 + IL_0032: ldarg.1 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002b + + IL_003e: ret + } + + .method public static void f11(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 5 + .locals init (uint32 V_0, + uint32 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint32) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint32 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint32) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: 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 uint32 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: stsfld uint32 ''.$assembly::c@1 + IL_0006: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs new file mode 100644 index 00000000000..2a9b1627344 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs @@ -0,0 +1,57 @@ +let mutable c = 0UL + +let f0 () = + for n in 10UL..1UL do + c <- n + +let f00 () = + for n in 10UL..1UL..1UL do + c <- n + +let f1 () = + for n in 1UL..10UL do + c <- n + +let f2 start = + for n in start..10UL do + c <- n + +let f3 finish = + for n in 1UL..finish do + c <- n + +let f4 (start: uint64) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1UL..1UL..10UL do + c <- n + +let f6 () = + for n in 1UL..2UL..10UL do + c <- n + +let f7 start = + for n in start..2UL..10UL do + c <- n + +let f8 step = + for n in 1UL..step..10UL do + c <- n + +let f9 finish = + for n in 1UL..2UL..finish do + c <- n + +let f10 (start: uint64) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0UL..finish do + c <- n + +let f12 () = + for n in 1UL..0UL..10UL do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl new file mode 100644 index 00000000000..8076772e763 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -0,0 +1,859 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f7(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_0017 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret + } + + .method public static void f8(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 + + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 9 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: div.un + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: stloc.0 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.1 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: stloc.2 + IL_0022: br.s IL_0033 + + IL_0024: ldloc.2 + IL_0025: call void assembly::set_c(uint64) + IL_002a: ldloc.2 + IL_002b: ldarg.0 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.1 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.1 + IL_0033: ldloc.1 + IL_0034: ldloc.0 + IL_0035: blt.un.s IL_0024 + + IL_0037: ret + } + + .method public static void f9(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_0015 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + 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(uint64) + IL_0024: ldloc.2 + IL_0025: ldc.i4.2 + 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 f10(uint64 start, + uint64 step, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_001f + + IL_0019: ldarg.2 + IL_001a: ldarg.2 + IL_001b: sub + IL_001c: ldarg.1 + IL_001d: div.un + IL_001e: nop + IL_001f: stloc.0 + IL_0020: ldloc.0 + IL_0021: ldc.i4.m1 + IL_0022: conv.i8 + IL_0023: bne.un.s IL_0047 + + IL_0025: ldc.i4.1 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldarg.2 + IL_002b: stloc.3 + IL_002c: br.s IL_0043 + + IL_002e: ldloc.3 + IL_002f: call void assembly::set_c(uint64) + IL_0034: ldloc.3 + IL_0035: ldarg.1 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.2 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.2 + IL_003e: ldc.i4.0 + IL_003f: conv.i8 + IL_0040: cgt.un + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: brtrue.s IL_002e + + IL_0046: ret + + IL_0047: ldarg.2 + IL_0048: ldarg.2 + IL_0049: bge.un.s IL_0050 + + IL_004b: ldc.i4.0 + IL_004c: conv.i8 + IL_004d: nop + IL_004e: br.s IL_0059 + + IL_0050: ldarg.2 + IL_0051: ldarg.2 + IL_0052: sub + IL_0053: ldarg.1 + IL_0054: div.un + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add.ovf.un + IL_0058: nop + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.3 + IL_005d: ldarg.2 + IL_005e: stloc.s V_4 + IL_0060: br.s IL_0074 + + IL_0062: ldloc.s V_4 + IL_0064: call void assembly::set_c(uint64) + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldloc.2 + IL_0076: blt.un.s IL_0062 + + IL_0078: ret + } + + .method public static void f11(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 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldarg.0 + IL_0011: stloc.2 + IL_0012: br.s IL_0024 + + IL_0014: ldloc.2 + IL_0015: call void assembly::set_c(uint64) + IL_001a: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.2 + IL_001f: ldloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0014 + + IL_0028: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 + IL_0003: conv.i8 + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: br.s IL_0028 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + 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_0018 + + IL_002c: 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 uint64 c@1 + .custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .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: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stsfld uint64 ''.$assembly::c@1 + IL_0007: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs new file mode 100644 index 00000000000..0ec7970c52a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs @@ -0,0 +1,57 @@ +let mutable c = 0un + +let f0 () = + for n in 10un..1un do + c <- n + +let f00 () = + for n in 10un..1un..1un do + c <- n + +let f1 () = + for n in 1un..10un do + c <- n + +let f2 start = + for n in start..10un do + c <- n + +let f3 finish = + for n in 1un..finish do + c <- n + +let f4 (start: unativeint) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1un..1un..10un do + c <- n + +let f6 () = + for n in 1un..2un..10un do + c <- n + +let f7 start = + for n in start..2un..10un do + c <- n + +let f8 step = + for n in 1un..step..10un do + c <- n + +let f9 finish = + for n in 1un..2un..finish do + c <- n + +let f10 (start: unativeint) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0un..finish do + c <- n + +let f12 () = + for n in 1un..0un..10un do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl new file mode 100644 index 00000000000..9af9230923b --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -0,0 +1,1110 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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 0x2 + 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 0x5 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f7(native uint start) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + 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_003d + + IL_001a: ldc.i8 0xa + IL_0023: conv.u + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.u + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.u + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.u + IL_0048: stloc.1 + IL_0049: ldarg.0 + IL_004a: stloc.2 + IL_004b: br.s IL_006d + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(native uint) + IL_0053: ldloc.2 + IL_0054: ldc.i8 0x2 + IL_005d: conv.u + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.1 + IL_0061: ldc.i8 0x1 + IL_006a: conv.u + IL_006b: add + IL_006c: stloc.1 + IL_006d: ldloc.1 + IL_006e: ldloc.0 + IL_006f: blt.un.s IL_004d + + IL_0071: ret + } + + .method public static void f8(native uint step) cil managed + { + + .maxstack 5 + .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 0x0 + IL_000a: conv.u + IL_000b: bne.un.s IL_002b + + IL_000d: ldc.i8 0x1 + IL_0016: conv.u + IL_0017: ldarg.0 + IL_0018: ldc.i8 0xa + IL_0021: conv.u + IL_0022: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0027: pop + IL_0028: nop + IL_0029: br.s IL_002c + + IL_002b: nop + IL_002c: ldc.i8 0xa + IL_0035: conv.u + IL_0036: ldc.i8 0x1 + IL_003f: conv.u + IL_0040: bge.un.s IL_004f + + IL_0042: ldc.i8 0x0 + IL_004b: conv.u + IL_004c: nop + IL_004d: br.s IL_0067 + + IL_004f: ldc.i8 0xa + IL_0058: conv.u + IL_0059: ldc.i8 0x1 + IL_0062: conv.u + IL_0063: sub + IL_0064: ldarg.0 + IL_0065: div.un + IL_0066: nop + IL_0067: stloc.0 + IL_0068: sizeof [runtime]System.IntPtr + IL_006e: ldc.i4.4 + IL_006f: bne.un.s IL_0081 + + IL_0071: ldloc.0 + IL_0072: ldc.i8 0xffffffff + IL_007b: conv.u + IL_007c: ceq + IL_007e: nop + IL_007f: br.s IL_008f + + IL_0081: ldloc.0 + IL_0082: ldc.i8 0xffffffffffffffff + IL_008b: conv.u + IL_008c: ceq + IL_008e: nop + IL_008f: brfalse.s IL_00d4 + + IL_0091: ldc.i4.1 + IL_0092: stloc.1 + IL_0093: ldc.i8 0x0 + IL_009c: conv.u + IL_009d: stloc.2 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: stloc.3 + IL_00a9: br.s IL_00d0 + + IL_00ab: ldloc.3 + IL_00ac: call void assembly::set_c(native uint) + IL_00b1: ldloc.3 + IL_00b2: ldarg.0 + IL_00b3: add + IL_00b4: stloc.3 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x1 + IL_00bf: conv.u + IL_00c0: add + IL_00c1: stloc.2 + IL_00c2: ldloc.2 + IL_00c3: ldc.i8 0x0 + IL_00cc: conv.u + IL_00cd: cgt.un + IL_00cf: stloc.1 + IL_00d0: ldloc.1 + IL_00d1: brtrue.s IL_00ab + + IL_00d3: ret + + IL_00d4: ldc.i8 0xa + IL_00dd: conv.u + IL_00de: ldc.i8 0x1 + IL_00e7: conv.u + IL_00e8: bge.un.s IL_00f7 + + IL_00ea: ldc.i8 0x0 + IL_00f3: conv.u + IL_00f4: nop + IL_00f5: br.s IL_011a + + IL_00f7: ldc.i8 0xa + IL_0100: conv.u + IL_0101: ldc.i8 0x1 + IL_010a: conv.u + IL_010b: sub + IL_010c: ldarg.0 + IL_010d: div.un + IL_010e: ldc.i8 0x1 + IL_0117: conv.u + IL_0118: add.ovf.un + IL_0119: nop + IL_011a: stloc.2 + IL_011b: ldc.i8 0x0 + IL_0124: conv.u + IL_0125: stloc.3 + IL_0126: ldc.i8 0x1 + IL_012f: conv.u + IL_0130: stloc.s V_4 + IL_0132: br.s IL_014e + + IL_0134: ldloc.s V_4 + IL_0136: call void assembly::set_c(native uint) + IL_013b: ldloc.s V_4 + IL_013d: ldarg.0 + IL_013e: add + IL_013f: stloc.s V_4 + IL_0141: ldloc.3 + IL_0142: ldc.i8 0x1 + IL_014b: conv.u + IL_014c: add + IL_014d: stloc.3 + IL_014e: ldloc.3 + IL_014f: ldloc.2 + IL_0150: blt.un.s IL_0134 + + IL_0152: ret + } + + .method public static void f9(native uint finish) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + 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_003d + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.u + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.u + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.u + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.u + IL_0048: stloc.1 + IL_0049: ldc.i8 0x1 + IL_0052: conv.u + IL_0053: stloc.2 + IL_0054: br.s IL_0076 + + IL_0056: ldloc.2 + IL_0057: call void assembly::set_c(native uint) + IL_005c: ldloc.2 + IL_005d: ldc.i8 0x2 + IL_0066: conv.u + IL_0067: add + IL_0068: stloc.2 + IL_0069: ldloc.1 + IL_006a: ldc.i8 0x1 + IL_0073: conv.u + IL_0074: add + IL_0075: stloc.1 + IL_0076: ldloc.1 + IL_0077: ldloc.0 + IL_0078: blt.un.s IL_0056 + + IL_007a: ret + } + + .method public static void f10(native uint start, + native uint step, + native uint finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .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: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: bne.un.s IL_0019 + + IL_000d: ldarg.2 + IL_000e: ldarg.1 + IL_000f: ldarg.2 + IL_0010: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0015: pop + IL_0016: nop + IL_0017: br.s IL_001a + + IL_0019: nop + IL_001a: ldarg.2 + IL_001b: ldarg.2 + IL_001c: bge.un.s IL_002b + + IL_001e: ldc.i8 0x0 + IL_0027: conv.u + IL_0028: nop + IL_0029: br.s IL_0031 + + IL_002b: ldarg.2 + IL_002c: ldarg.2 + IL_002d: sub + IL_002e: ldarg.1 + IL_002f: div.un + IL_0030: nop + IL_0031: stloc.0 + IL_0032: sizeof [runtime]System.IntPtr + IL_0038: ldc.i4.4 + IL_0039: bne.un.s IL_004b + + IL_003b: ldloc.0 + IL_003c: ldc.i8 0xffffffff + IL_0045: conv.u + IL_0046: ceq + IL_0048: nop + IL_0049: br.s IL_0059 + + IL_004b: ldloc.0 + IL_004c: ldc.i8 0xffffffffffffffff + IL_0055: conv.u + IL_0056: ceq + IL_0058: nop + IL_0059: brfalse.s IL_0095 + + IL_005b: ldc.i4.1 + IL_005c: stloc.1 + IL_005d: ldc.i8 0x0 + IL_0066: conv.u + IL_0067: stloc.2 + IL_0068: ldarg.2 + IL_0069: stloc.3 + IL_006a: br.s IL_0091 + + IL_006c: ldloc.3 + IL_006d: call void assembly::set_c(native uint) + IL_0072: ldloc.3 + IL_0073: ldarg.1 + IL_0074: add + IL_0075: stloc.3 + IL_0076: ldloc.2 + IL_0077: ldc.i8 0x1 + IL_0080: conv.u + IL_0081: add + IL_0082: stloc.2 + IL_0083: ldloc.2 + IL_0084: ldc.i8 0x0 + IL_008d: conv.u + IL_008e: cgt.un + IL_0090: stloc.1 + IL_0091: ldloc.1 + IL_0092: brtrue.s IL_006c + + IL_0094: ret + + IL_0095: ldarg.2 + IL_0096: ldarg.2 + IL_0097: bge.un.s IL_00a6 + + IL_0099: ldc.i8 0x0 + IL_00a2: conv.u + IL_00a3: nop + IL_00a4: br.s IL_00b7 + + IL_00a6: ldarg.2 + IL_00a7: ldarg.2 + IL_00a8: sub + IL_00a9: ldarg.1 + IL_00aa: div.un + IL_00ab: ldc.i8 0x1 + IL_00b4: conv.u + IL_00b5: add.ovf.un + IL_00b6: nop + IL_00b7: stloc.2 + IL_00b8: ldc.i8 0x0 + IL_00c1: conv.u + IL_00c2: stloc.3 + IL_00c3: ldarg.2 + IL_00c4: stloc.s V_4 + IL_00c6: br.s IL_00e2 + + IL_00c8: ldloc.s V_4 + IL_00ca: call void assembly::set_c(native uint) + IL_00cf: ldloc.s V_4 + IL_00d1: ldarg.1 + IL_00d2: add + IL_00d3: stloc.s V_4 + IL_00d5: ldloc.3 + IL_00d6: ldc.i8 0x1 + IL_00df: conv.u + IL_00e0: add + IL_00e1: stloc.3 + IL_00e2: ldloc.3 + IL_00e3: ldloc.2 + IL_00e4: blt.un.s IL_00c8 + + IL_00e6: ret + } + + .method public static void f11(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 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0011: pop + IL_0012: ldc.i8 0x0 + IL_001b: conv.u + IL_001c: stloc.0 + IL_001d: ldc.i8 0x0 + IL_0026: conv.u + IL_0027: stloc.1 + IL_0028: ldarg.0 + IL_0029: stloc.2 + IL_002a: br.s IL_004c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(native uint) + IL_0032: ldloc.2 + IL_0033: ldc.i8 0x0 + IL_003c: conv.u + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i8 0x1 + IL_0049: conv.u + IL_004a: add + IL_004b: stloc.1 + IL_004c: ldloc.1 + IL_004d: ldloc.0 + IL_004e: blt.un.s IL_002c + + IL_0050: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldc.i8 0x1 + IL_0009: conv.u + IL_000a: ldc.i8 0x0 + IL_0013: conv.u + IL_0014: ldc.i8 0xa + IL_001d: conv.u + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0023: pop + IL_0024: ldc.i8 0x0 + IL_002d: conv.u + IL_002e: stloc.0 + IL_002f: ldc.i8 0x0 + IL_0038: conv.u + IL_0039: stloc.1 + IL_003a: ldc.i8 0x1 + IL_0043: conv.u + IL_0044: stloc.2 + IL_0045: br.s IL_0067 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(native uint) + IL_004d: ldloc.2 + IL_004e: ldc.i8 0x0 + IL_0057: conv.u + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.1 + IL_005b: ldc.i8 0x1 + IL_0064: conv.u + IL_0065: add + IL_0066: stloc.1 + IL_0067: ldloc.1 + IL_0068: ldloc.0 + IL_0069: blt.un.s IL_0047 + + IL_006b: 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 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 ) + .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: ldc.i8 0x0 + IL_0009: conv.u + IL_000a: stsfld native uint ''.$assembly::c@1 + IL_000f: ret + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForLoop.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForLoop.fs index d670348ae71..58bd7c3bd2d 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/ForLoop.fs @@ -131,3 +131,79 @@ module ForLoopRealInternalSignatureOff = compilation |> verifyCompilation + // SOURCE=ForEachRangeStepSByte.fs SCFLAGS="--optimize+" # ForEachRangeStepSByte.fs --optimize+ + [] + let ``ForEachRangeStepSByte_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepByte.fs SCFLAGS="--optimize+" # ForEachRangeStepByte.fs --optimize+ + [] + let ``ForEachRangeStepByte_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepChar.fs SCFLAGS="--optimize+" # ForEachRangeStepChar.fs --optimize+ + [] + let ``ForEachRangeStepChar_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt16.fs SCFLAGS="--optimize+" # ForEachRangeStepInt16.fs --optimize+ + [] + let ``ForEachRangeStepInt16_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt16.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt16.fs --optimize+ + [] + let ``ForEachRangeStepUInt16_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt32.fs SCFLAGS="--optimize+" # ForEachRangeStepInt32.fs --optimize+ + [] + let ``ForEachRangeStepInt32_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt32.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt32.fs --optimize+ + [] + let ``ForEachRangeStepUInt32_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt64.fs SCFLAGS="--optimize+" # ForEachRangeStepInt64.fs --optimize+ + [] + let ``ForEachRangeStepInt64_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt64.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt64.fs --optimize+ + [] + let ``ForEachRangeStepUInt64_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepIntPtr.fs SCFLAGS="--optimize+" # ForEachRangeStepIntPtr.fs --optimize+ + [] + let ``ForEachRangeStepIntPtr_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUIntPtr.fs SCFLAGS="--optimize+" # ForEachRangeStepUIntPtr.fs --optimize+ + [] + let ``ForEachRangeStepUIntPtr_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.il.bsl index f4f037c9936..fb5c2acf0b3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -43,8 +43,7 @@ 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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index f4f037c9936..fb5c2acf0b3 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -43,8 +43,7 @@ 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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 7229991ff4b..afcb05828cd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -43,8 +43,7 @@ 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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 7229991ff4b..afcb05828cd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOff/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -43,8 +43,7 @@ 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 specialname static int32[] - get_r() cil managed + .method public specialname static int32[] get_r() cil managed { .maxstack 8 @@ -52,8 +51,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_w() cil managed + .method public specialname static int32[] get_w() cil managed { .maxstack 8 @@ -61,8 +59,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_current@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_current@9() cil managed { .maxstack 8 @@ -70,8 +67,7 @@ IL_0005: ret } - .method assembly specialname static void - set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 @@ -80,8 +76,7 @@ IL_0006: ret } - .method assembly specialname static int32 - get_e1@1() cil managed + .method assembly specialname static int32 get_e1@1() cil managed { .maxstack 8 @@ -89,8 +84,7 @@ IL_0005: ret } - .method assembly specialname static int32 - get_e2@1() cil managed + .method assembly specialname static int32 get_e2@1() cil managed { .maxstack 8 @@ -98,8 +92,7 @@ IL_0005: ret } - .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_next@9() cil managed + .method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_next@9() cil managed { .maxstack 8 @@ -107,8 +100,7 @@ IL_0005: ret } - .method assembly specialname static void - set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed + .method assembly specialname static void set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 'value') cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepByte.fs new file mode 100644 index 00000000000..f4e047fb3d5 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepByte.fs @@ -0,0 +1,57 @@ +let mutable c = 0uy + +let f0 () = + for n in 10uy..1uy do + c <- n + +let f00 () = + for n in 10uy..1uy..1uy do + c <- n + +let f1 () = + for n in 1uy..10uy do + c <- n + +let f2 start = + for n in start..10uy do + c <- n + +let f3 finish = + for n in 1uy..finish do + c <- n + +let f4 (start: byte) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1uy..1uy..10uy do + c <- n + +let f6 () = + for n in 1uy..2uy..10uy do + c <- n + +let f7uy start = + for n in start..2uy..10uy do + c <- n + +let f8 step = + for n in 1uy..step..10uy do + c <- n + +let f9 finish = + for n in 1uy..2uy..finish do + c <- n + +let f10 (start: byte) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0uy..finish do + c <- n + +let f12 () = + for n in 1uy..0uy..10uy do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepByte.fs.opt.il.bsl new file mode 100644 index 00000000000..83c83d6eac2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepByte.fs.opt.il.bsl @@ -0,0 +1,693 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7uy(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint8) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(uint8 step) cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u2 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: stloc.1 + IL_001b: ldc.i4.1 + IL_001c: stloc.2 + IL_001d: br.s IL_002d + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint8) + IL_0025: ldloc.2 + IL_0026: ldarg.0 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001f + + IL_0031: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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: ldc.i4.1 + 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.2 + 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 f10(uint8 start, + uint8 step, + uint8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint8 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0018 + + IL_0014: ldc.i4.0 + IL_0015: nop + IL_0016: br.s IL_0021 + + IL_0018: ldarg.2 + IL_0019: ldarg.2 + IL_001a: sub + IL_001b: ldarg.1 + IL_001c: div.un + IL_001d: conv.u2 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldarg.2 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(uint8) + IL_002e: ldloc.2 + IL_002f: ldarg.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f11(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 5 + .locals init (uint8 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint8) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint8 V_0, + uint8 V_1, + uint8 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, + uint8, + uint8) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint8) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: 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/RealInternalSignatureOn/ForEachRangeStepChar.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepChar.fs new file mode 100644 index 00000000000..137044d13b9 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepChar.fs @@ -0,0 +1,57 @@ +let mutable c = '\000' + +let f0 () = + for n in 'z'..'a' do + c <- n + +let f00 () = + for n in 'z'..'\001'..'a' do + c <- n + +let f1 () = + for n in 'a'..'z' do + c <- n + +let f2 start = + for n in start..'z' do + c <- n + +let f3 finish = + for n in 'a'..finish do + c <- n + +let f4 (start: char) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 'a'..'\001'..'z' do + c <- n + +let f6 () = + for n in 'a'..'\002'..'z' do + c <- n + +let f7 start = + for n in start..'\002'..'z' do + c <- n + +let f8 step = + for n in 'a'..step..'z' do + c <- n + +let f9 finish = + for n in 'a'..'\002'..finish do + c <- n + +let f10 (start: char) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..'\000'..finish do + c <- n + +let f12 () = + for n in 'a'..'\000'..'z' do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepChar.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepChar.fs.opt.il.bsl new file mode 100644 index 00000000000..f383fcd5612 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepChar.fs.opt.il.bsl @@ -0,0 +1,869 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 auto ansi serializable sealed nested assembly beforefieldinit f8@40 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f8@40 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f8@40::.ctor() + IL_0005: stsfld class assembly/f8@40 assembly/f8@40::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f10@48 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f10@48 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f10@48::.ctor() + IL_0005: stsfld class assembly/f10@48 assembly/f10@48::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f11@52 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f11@52 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f11@52::.ctor() + IL_0005: stsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_000a: ret + } + + } + + .class auto ansi serializable sealed nested assembly beforefieldinit f12@56 + extends class [FSharp.Core]Microsoft.FSharp.Core.OptimizedClosures/FSharpFunc`3 + { + .field static assembly initonly class assembly/f12@56 @_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 char + Invoke(char x, + char y) cil managed + { + + .maxstack 8 + IL_0000: ldarg.1 + IL_0001: ldarg.2 + IL_0002: add.ovf.un + IL_0003: conv.ovf.u2.un + IL_0004: ret + } + + .method private specialname rtspecialname static void .cctor() cil managed + { + + .maxstack 10 + IL_0000: newobj instance void assembly/f12@56::.ctor() + IL_0005: stsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_000a: 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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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 13 + IL_0018: blt.un.s IL_0007 + + IL_001a: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 122 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(char step) cil managed + { + + .maxstack 7 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: bne.un.s IL_0018 + + IL_0004: ldc.i4.0 + IL_0005: ldsfld class assembly/f8@40 assembly/f8@40::@_instance + IL_000a: ldc.i4.s 97 + IL_000c: ldarg.0 + IL_000d: ldc.i4.s 122 + IL_000f: 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_0014: pop + IL_0015: nop + IL_0016: br.s IL_0019 + + IL_0018: nop + IL_0019: ldc.i4.s 122 + IL_001b: ldc.i4.s 97 + IL_001d: sub + IL_001e: ldarg.0 + IL_001f: div.un + IL_0020: conv.u4 + IL_0021: ldc.i4.1 + IL_0022: add + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: stloc.1 + IL_0026: ldc.i4.s 97 + IL_0028: stloc.2 + IL_0029: br.s IL_0039 + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(char) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: add + IL_0038: stloc.1 + IL_0039: ldloc.1 + IL_003a: ldloc.0 + IL_003b: blt.un.s IL_002b + + IL_003d: ret + } + + .method public static void f9(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_0013 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.s 97 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldc.i4.s 97 + IL_0018: stloc.2 + IL_0019: br.s IL_0029 + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(char) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + IL_0023: add + IL_0024: stloc.2 + IL_0025: ldloc.1 + IL_0026: ldc.i4.1 + IL_0027: add + IL_0028: stloc.1 + IL_0029: ldloc.1 + IL_002a: ldloc.0 + IL_002b: blt.un.s IL_001b + + IL_002d: ret + } + + .method public static void f10(char start, + char step, + char finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 7 + .locals init (uint32 V_0, + uint32 V_1, + char V_2) + IL_0000: ldarg.1 + IL_0001: ldc.i4.0 + IL_0002: bne.un.s IL_0016 + + IL_0004: ldc.i4.0 + IL_0005: ldsfld class assembly/f10@48 assembly/f10@48::@_instance + IL_000a: ldarg.2 + IL_000b: ldarg.1 + IL_000c: ldarg.2 + IL_000d: 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_0012: pop + IL_0013: nop + IL_0014: br.s IL_0017 + + IL_0016: nop + IL_0017: ldarg.2 + IL_0018: ldarg.2 + IL_0019: bge.un.s IL_001f + + IL_001b: ldc.i4.0 + IL_001c: nop + IL_001d: br.s IL_0028 + + IL_001f: ldarg.2 + IL_0020: ldarg.2 + IL_0021: sub + IL_0022: ldarg.1 + IL_0023: div.un + IL_0024: conv.u4 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: nop + IL_0028: stloc.0 + IL_0029: ldc.i4.0 + IL_002a: stloc.1 + IL_002b: ldarg.2 + IL_002c: stloc.2 + IL_002d: br.s IL_003d + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(char) + IL_0035: ldloc.2 + IL_0036: ldarg.1 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: add + IL_003c: stloc.1 + IL_003d: ldloc.1 + IL_003e: ldloc.0 + IL_003f: blt.un.s IL_002f + + IL_0041: ret + } + + .method public static void f11(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 7 + .locals init (char V_0, + char V_1, + char V_2) + IL_0000: ldc.i4.0 + IL_0001: ldsfld class assembly/f11@52 assembly/f11@52::@_instance + IL_0006: ldarg.0 + IL_0007: ldc.i4.0 + IL_0008: ldarg.1 + IL_0009: 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_000e: pop + IL_000f: ldc.i4.0 + IL_0010: stloc.0 + IL_0011: ldc.i4.0 + IL_0012: stloc.1 + IL_0013: ldarg.0 + IL_0014: stloc.2 + IL_0015: br.s IL_0025 + + IL_0017: ldloc.2 + IL_0018: call void assembly::set_c(char) + IL_001d: ldloc.2 + IL_001e: ldc.i4.0 + IL_001f: add + IL_0020: stloc.2 + IL_0021: ldloc.1 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: stloc.1 + IL_0025: ldloc.1 + IL_0026: ldloc.0 + IL_0027: blt.un.s IL_0017 + + IL_0029: ret + } + + .method public static void f12() cil managed + { + + .maxstack 7 + .locals init (char V_0, + char V_1, + char V_2) + IL_0000: ldc.i4.0 + IL_0001: ldsfld class assembly/f12@56 assembly/f12@56::@_instance + IL_0006: ldc.i4.s 97 + IL_0008: ldc.i4.0 + IL_0009: ldc.i4.s 122 + IL_000b: 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_0010: pop + IL_0011: ldc.i4.0 + IL_0012: stloc.0 + IL_0013: ldc.i4.0 + IL_0014: stloc.1 + IL_0015: ldc.i4.s 97 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(char) + IL_0020: ldloc.2 + IL_0021: ldc.i4.0 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: 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/RealInternalSignatureOn/ForEachRangeStepInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt16.fs new file mode 100644 index 00000000000..f664f0ad2de --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt16.fs @@ -0,0 +1,65 @@ +let mutable c = 0s + +let f0 () = + for n in 10s..1s do + c <- n + +let f00 () = + for n in 10s..1s..1s do + c <- n + +let f1 () = + for n in 1s..10s do + c <- n + +let f2 start = + for n in start..10s do + c <- n + +let f3 finish = + for n in 1s..finish do + c <- n + +let f4 (start: int16) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1s..1s..10s do + c <- n + +let f6 () = + for n in 1s..2s..10s do + c <- n + +let f7 start = + for n in start..2s..10s do + c <- n + +let f8 step = + for n in 1s..step..10s do + c <- n + +let f9 finish = + for n in 1s..2s..finish do + c <- n + +let f10 (start: int16) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0s..finish do + c <- n + +let f12 () = + for n in 1s..0s..10s do + c <- n + +let f13 () = + for n in 10s .. -1s .. 1s do + c <- n + +let f14 () = + for n in 10s .. -2s .. 1s do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt16.fs.opt.il.bsl new file mode 100644 index 00000000000..b8f92098223 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt16.fs.opt.il.bsl @@ -0,0 +1,786 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.i4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int16) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(int16 step) cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_001f + + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: conv.i4 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: ldc.i4.0 + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldc.i4.1 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(int16) + IL_002e: ldloc.2 + IL_002f: ldarg.0 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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.1 + 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.2 + 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 f10(int16 start, + int16 step, + int16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + int16 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0027 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: nop + IL_001a: br.s IL_003b + + IL_001c: ldarg.2 + IL_001d: ldarg.2 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: div.un + IL_0021: conv.i4 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: nop + IL_0025: br.s IL_003b + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: nop + IL_002d: br.s IL_003b + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: div.un + IL_0037: conv.i4 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: nop + IL_003b: stloc.0 + IL_003c: ldc.i4.0 + IL_003d: stloc.1 + IL_003e: ldarg.2 + IL_003f: stloc.2 + IL_0040: br.s IL_0050 + + IL_0042: ldloc.2 + IL_0043: call void assembly::set_c(int16) + IL_0048: ldloc.2 + IL_0049: ldarg.1 + IL_004a: add + IL_004b: stloc.2 + IL_004c: ldloc.1 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.1 + IL_0050: ldloc.1 + IL_0051: ldloc.0 + IL_0052: blt.un.s IL_0042 + + IL_0054: ret + } + + .method public static void f11(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 5 + .locals init (int16 V_0, + int16 V_1, + int16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int16) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int16 V_0, + int16 V_1, + int16 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt16(int16, + int16, + int16) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int16) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret + } + + .method public static void f13() 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 f14() 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_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int16) + IL_000d: ldloc.1 + IL_000e: ldc.i4.s -2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: blt.un.s IL_0007 + + IL_001a: 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/RealInternalSignatureOn/ForEachRangeStepInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt32.fs new file mode 100644 index 00000000000..32bca951da3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt32.fs @@ -0,0 +1,65 @@ +let mutable c = 0 + +let f0 () = + for n in 10..1 do + c <- n + +let f00 () = + for n in 10..1..1 do + c <- n + +let f1 () = + for n in 1..10 do + c <- n + +let f2 start = + for n in start..10 do + c <- n + +let f3 finish = + for n in 1..finish do + c <- n + +let f4 start finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1..1..10 do + c <- n + +let f6 () = + for n in 1..2..10 do + c <- n + +let f7 start = + for n in start..2..10 do + c <- n + +let f8 step = + for n in 1..step..10 do + c <- n + +let f9 finish = + for n in 1..2..finish do + c <- n + +let f10 start step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0..finish do + c <- n + +let f12 () = + for n in 1..0..10 do + c <- n + +let f13 () = + for n in 10..-1..1 do + c <- n + +let f14 () = + for n in 10..-2..1 do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt32.fs.opt.il.bsl new file mode 100644 index 00000000000..ae30a8e844f --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt32.fs.opt.il.bsl @@ -0,0 +1,744 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .field static assembly int32 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 int32 get_c() cil managed + { + + .maxstack 8 + IL_0000: ldsfld int32 assembly::c@1 + 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@1 + IL_0006: ret + } + + .method public static void f0() 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 f00() cil managed + { + + .maxstack 4 + .locals init (int32 V_0, + int32 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(int32) + 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 f1() 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 f2(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 f3(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 f4(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 f5() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 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(int32) + 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 f6() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 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(int32) + IL_000d: ldloc.1 + IL_000e: ldc.i4.2 + 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.5 + IL_0018: conv.i8 + IL_0019: blt.un.s IL_0007 + + IL_001b: ret + } + + .method public static void f7(int32 start) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldc.i4.s 10 + IL_0002: ldarg.0 + IL_0003: bge.s IL_000a + + IL_0005: ldc.i4.0 + IL_0006: conv.i8 + IL_0007: nop + IL_0008: br.s IL_0015 + + IL_000a: ldc.i4.s 10 + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: div.un + IL_0010: conv.i8 + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldarg.0 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(int32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + 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_001d + + IL_0030: ret + } + + .method public static void f8(int32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_0020 + + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: conv.i8 + IL_001a: ldc.i4.1 + IL_001b: conv.i8 + IL_001c: add + IL_001d: nop + IL_001e: br.s IL_0023 + + IL_0020: ldc.i4.0 + IL_0021: conv.i8 + IL_0022: nop + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: stloc.1 + IL_0027: ldc.i4.1 + IL_0028: stloc.2 + IL_0029: br.s IL_003a + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(int32) + IL_0031: ldloc.2 + IL_0032: ldarg.0 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002b + + IL_003e: ret + } + + .method public static void f9(int32 finish) cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.1 + IL_0002: bge.s IL_0009 + + IL_0004: ldc.i4.0 + IL_0005: conv.i8 + IL_0006: nop + IL_0007: br.s IL_0013 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: ldc.i4.2 + IL_000d: div.un + IL_000e: conv.i8 + 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: ldc.i4.1 + IL_0018: stloc.2 + IL_0019: br.s IL_002a + + IL_001b: ldloc.2 + IL_001c: call void assembly::set_c(int32) + IL_0021: ldloc.2 + IL_0022: ldc.i4.2 + 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 f10(!!a start, + int32 step, + int32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int32 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0029 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001d + + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: nop + IL_001b: br.s IL_003f + + IL_001d: ldarg.2 + IL_001e: ldarg.2 + IL_001f: sub + IL_0020: ldarg.1 + IL_0021: div.un + IL_0022: conv.i8 + IL_0023: ldc.i4.1 + IL_0024: conv.i8 + IL_0025: add + IL_0026: nop + IL_0027: br.s IL_003f + + IL_0029: ldarg.2 + IL_002a: ldarg.2 + IL_002b: bge.s IL_0032 + + IL_002d: ldc.i4.0 + IL_002e: conv.i8 + IL_002f: nop + IL_0030: br.s IL_003f + + IL_0032: ldarg.2 + IL_0033: ldarg.2 + IL_0034: sub + IL_0035: ldarg.1 + IL_0036: not + IL_0037: ldc.i4.1 + IL_0038: add + IL_0039: div.un + IL_003a: conv.i8 + IL_003b: ldc.i4.1 + IL_003c: conv.i8 + IL_003d: add + IL_003e: nop + IL_003f: stloc.0 + IL_0040: ldc.i4.0 + IL_0041: conv.i8 + IL_0042: stloc.1 + IL_0043: ldarg.2 + IL_0044: stloc.2 + IL_0045: br.s IL_0056 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(int32) + IL_004d: ldloc.2 + IL_004e: ldarg.1 + IL_004f: add + IL_0050: stloc.2 + IL_0051: ldloc.1 + IL_0052: ldc.i4.1 + IL_0053: conv.i8 + IL_0054: add + IL_0055: stloc.1 + IL_0056: ldloc.1 + IL_0057: ldloc.0 + IL_0058: blt.un.s IL_0047 + + IL_005a: ret + } + + .method public static void f11(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, + int32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int32) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int32 V_0, + int32 V_1, + int32 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int32) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret + } + + .method public static void f13() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.1 + IL_0006: br.s IL_0017 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.m1 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add + IL_0016: stloc.0 + IL_0017: ldloc.0 + IL_0018: ldc.i4.s 10 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f14() cil managed + { + + .maxstack 4 + .locals init (uint64 V_0, + int32 V_1) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.0 + IL_0003: ldc.i4.s 10 + IL_0005: stloc.1 + IL_0006: br.s IL_0018 + + IL_0008: ldloc.1 + IL_0009: call void assembly::set_c(int32) + IL_000e: ldloc.1 + IL_000f: ldc.i4.s -2 + 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.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: 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@1 + 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/RealInternalSignatureOn/ForEachRangeStepInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs new file mode 100644 index 00000000000..9e272eb300a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs @@ -0,0 +1,65 @@ +let mutable c = 0L + +let f0 () = + for n in 10L..1L do + c <- n + +let f00 () = + for n in 10L..1L..1L do + c <- n + +let f1 () = + for n in 1L..10L do + c <- n + +let f2 start = + for n in start..10L do + c <- n + +let f3 finish = + for n in 1L..finish do + c <- n + +let f4 (start: int64) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1L..1L..10L do + c <- n + +let f6 () = + for n in 1L..2L..10L do + c <- n + +let f7 start = + for n in start..2L..10L do + c <- n + +let f8 step = + for n in 1L..step..10L do + c <- n + +let f9 finish = + for n in 1L..2L..finish do + c <- n + +let f10 (start: int64) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0L..finish do + c <- n + +let f12 () = + for n in 1L..0L..10L do + c <- n + +let f13 () = + for n in 10L.. -1L ..1L do + c <- n + +let f14 () = + for n in 10L.. -2L ..1L do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl new file mode 100644 index 00000000000..3c567634da6 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepInt64.fs.opt.il.bsl @@ -0,0 +1,1012 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f7(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_0017 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(int64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret + } + + .method public static void f8(int64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 + + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.0 + IL_0014: conv.i8 + IL_0015: ldarg.0 + IL_0016: bge.s IL_0023 + + IL_0018: ldc.i4.s 9 + IL_001a: conv.i8 + IL_001b: ldarg.0 + IL_001c: div.un + IL_001d: ldc.i4.1 + IL_001e: conv.i8 + IL_001f: add.ovf.un + IL_0020: nop + IL_0021: br.s IL_0026 + + IL_0023: ldc.i4.0 + IL_0024: conv.i8 + IL_0025: nop + IL_0026: stloc.0 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.1 + IL_002a: ldc.i4.1 + IL_002b: conv.i8 + IL_002c: stloc.2 + IL_002d: br.s IL_003e + + IL_002f: ldloc.2 + IL_0030: call void assembly::set_c(int64) + IL_0035: ldloc.2 + IL_0036: ldarg.0 + IL_0037: add + IL_0038: stloc.2 + IL_0039: ldloc.1 + IL_003a: ldc.i4.1 + IL_003b: conv.i8 + IL_003c: add + IL_003d: stloc.1 + IL_003e: ldloc.1 + IL_003f: ldloc.0 + IL_0040: blt.un.s IL_002f + + IL_0042: ret + } + + .method public static void f9(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_0015 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + 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.2 + 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 f10(int64 start, + int64 step, + int64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + int64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: ldarg.1 + IL_0013: bge.s IL_0026 + + IL_0015: ldarg.2 + IL_0016: ldarg.2 + IL_0017: bge.s IL_001e + + IL_0019: ldc.i4.0 + IL_001a: conv.i8 + IL_001b: nop + IL_001c: br.s IL_0039 + + IL_001e: ldarg.2 + IL_001f: ldarg.2 + IL_0020: sub + IL_0021: ldarg.1 + IL_0022: div.un + IL_0023: nop + IL_0024: br.s IL_0039 + + IL_0026: ldarg.2 + IL_0027: ldarg.2 + IL_0028: bge.s IL_002f + + IL_002a: ldc.i4.0 + IL_002b: conv.i8 + IL_002c: nop + IL_002d: br.s IL_0039 + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: conv.i8 + IL_0036: add + IL_0037: div.un + IL_0038: nop + IL_0039: stloc.0 + IL_003a: ldloc.0 + IL_003b: ldc.i4.m1 + IL_003c: conv.i8 + IL_003d: bne.un.s IL_0061 + + IL_003f: ldc.i4.1 + IL_0040: stloc.1 + IL_0041: ldc.i4.0 + IL_0042: conv.i8 + IL_0043: stloc.2 + IL_0044: ldarg.2 + IL_0045: stloc.3 + IL_0046: br.s IL_005d + + IL_0048: ldloc.3 + IL_0049: call void assembly::set_c(int64) + IL_004e: ldloc.3 + IL_004f: ldarg.1 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.2 + IL_0053: ldc.i4.1 + IL_0054: conv.i8 + IL_0055: add + IL_0056: stloc.2 + IL_0057: ldloc.2 + IL_0058: ldc.i4.0 + IL_0059: conv.i8 + IL_005a: cgt.un + IL_005c: stloc.1 + IL_005d: ldloc.1 + IL_005e: brtrue.s IL_0048 + + IL_0060: ret + + IL_0061: ldc.i4.0 + IL_0062: conv.i8 + IL_0063: ldarg.1 + IL_0064: bge.s IL_007a + + IL_0066: ldarg.2 + IL_0067: ldarg.2 + IL_0068: bge.s IL_006f + + IL_006a: ldc.i4.0 + IL_006b: conv.i8 + IL_006c: nop + IL_006d: br.s IL_0090 + + IL_006f: ldarg.2 + IL_0070: ldarg.2 + IL_0071: sub + IL_0072: ldarg.1 + IL_0073: div.un + IL_0074: ldc.i4.1 + IL_0075: conv.i8 + IL_0076: add.ovf.un + IL_0077: nop + IL_0078: br.s IL_0090 + + IL_007a: ldarg.2 + IL_007b: ldarg.2 + IL_007c: bge.s IL_0083 + + IL_007e: ldc.i4.0 + IL_007f: conv.i8 + IL_0080: nop + IL_0081: br.s IL_0090 + + IL_0083: ldarg.2 + IL_0084: ldarg.2 + IL_0085: sub + IL_0086: ldarg.1 + IL_0087: not + IL_0088: ldc.i4.1 + IL_0089: conv.i8 + IL_008a: add + IL_008b: div.un + IL_008c: ldc.i4.1 + IL_008d: conv.i8 + IL_008e: add.ovf.un + IL_008f: nop + IL_0090: stloc.2 + IL_0091: ldc.i4.0 + IL_0092: conv.i8 + IL_0093: stloc.s V_4 + IL_0095: ldarg.2 + IL_0096: stloc.3 + IL_0097: br.s IL_00aa + + IL_0099: ldloc.3 + IL_009a: call void assembly::set_c(int64) + IL_009f: ldloc.3 + IL_00a0: ldarg.1 + IL_00a1: add + IL_00a2: stloc.3 + IL_00a3: ldloc.s V_4 + IL_00a5: ldc.i4.1 + IL_00a6: conv.i8 + IL_00a7: add + IL_00a8: stloc.s V_4 + IL_00aa: ldloc.s V_4 + IL_00ac: ldloc.2 + IL_00ad: blt.un.s IL_0099 + + IL_00af: ret + } + + .method public static void f11(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 5 + .locals init (int64 V_0, + int64 V_1, + int64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldarg.0 + IL_0011: stloc.2 + IL_0012: br.s IL_0024 + + IL_0014: ldloc.2 + IL_0015: call void assembly::set_c(int64) + IL_001a: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.2 + IL_001f: ldloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0014 + + IL_0028: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int64 V_0, + int64 V_1, + int64 V_2) + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 + IL_0003: conv.i8 + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt64(int64, + int64, + int64) + IL_000c: pop + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: br.s IL_0028 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(int64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + 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_0018 + + IL_002c: ret + } + + .method public static void f13() 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 f14() 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_001a + + IL_0009: ldloc.1 + IL_000a: call void assembly::set_c(int64) + IL_000f: ldloc.1 + IL_0010: ldc.i4.s -2 + IL_0012: conv.i8 + IL_0013: add + IL_0014: stloc.1 + IL_0015: ldloc.0 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldloc.0 + IL_001b: ldc.i4.5 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0009 + + IL_001f: 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/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs new file mode 100644 index 00000000000..31464a36932 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs @@ -0,0 +1,65 @@ +let mutable c = 0n + +let f0 () = + for n in 10n..1n do + c <- n + +let f00 () = + for n in 10n..1n..1n do + c <- n + +let f1 () = + for n in 1n..10n do + c <- n + +let f2 start = + for n in start..10n do + c <- n + +let f3 finish = + for n in 1n..finish do + c <- n + +let f4 (start: nativeint) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1n..1n..10n do + c <- n + +let f6 () = + for n in 1n..2n..10n do + c <- n + +let f7 start = + for n in start..2n..10n do + c <- n + +let f8 step = + for n in 1n..step..10n do + c <- n + +let f9 finish = + for n in 1n..2n..finish do + c <- n + +let f10 (start: nativeint) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0n..finish do + c <- n + +let f12 () = + for n in 1n..0n..10n do + c <- n + +let f13 () = + for n in 10n.. -1n ..1n do + c <- n + +let f14 () = + for n in 10n.. -2n ..1n do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl new file mode 100644 index 00000000000..ebfc4b43fb1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepIntPtr.fs.opt.il.bsl @@ -0,0 +1,1590 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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 0x2 + 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 0x5 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f7(native int start) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2) + 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_003d + + IL_001a: ldc.i8 0xa + IL_0023: conv.i + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.i + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.i + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: stloc.1 + IL_0049: ldarg.0 + IL_004a: stloc.2 + IL_004b: br.s IL_006d + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(native int) + IL_0053: ldloc.2 + IL_0054: ldc.i8 0x2 + IL_005d: conv.i + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.1 + IL_0061: ldc.i8 0x1 + IL_006a: conv.i + IL_006b: add + IL_006c: stloc.1 + IL_006d: ldloc.1 + IL_006e: ldloc.0 + IL_006f: blt.un.s IL_004d + + IL_0071: ret + } + + .method public static void f8(native int step) cil managed + { + + .maxstack 5 + .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 0x0 + IL_000a: conv.i + IL_000b: bne.un.s IL_002b + + IL_000d: ldc.i8 0x1 + IL_0016: conv.i + IL_0017: ldarg.0 + IL_0018: ldc.i8 0xa + IL_0021: conv.i + IL_0022: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0027: pop + IL_0028: nop + IL_0029: br.s IL_002c + + IL_002b: nop + IL_002c: ldc.i8 0x0 + IL_0035: conv.i + IL_0036: ldarg.0 + IL_0037: bge.s IL_0076 + + IL_0039: ldc.i8 0xa + IL_0042: conv.i + IL_0043: ldc.i8 0x1 + IL_004c: conv.i + IL_004d: bge.s IL_005c + + IL_004f: ldc.i8 0x0 + IL_0058: conv.i + IL_0059: nop + IL_005a: br.s IL_00bd + + IL_005c: ldc.i8 0xa + IL_0065: conv.i + IL_0066: ldc.i8 0x1 + IL_006f: conv.i + IL_0070: sub + IL_0071: ldarg.0 + IL_0072: div.un + IL_0073: nop + IL_0074: br.s IL_00bd + + IL_0076: ldc.i8 0x1 + IL_007f: conv.i + IL_0080: ldc.i8 0xa + IL_0089: conv.i + IL_008a: bge.s IL_0099 + + IL_008c: ldc.i8 0x0 + IL_0095: conv.i + IL_0096: nop + IL_0097: br.s IL_00bd + + IL_0099: ldc.i8 0x1 + IL_00a2: conv.i + IL_00a3: ldc.i8 0xa + IL_00ac: conv.i + IL_00ad: sub + IL_00ae: ldarg.0 + IL_00af: not + IL_00b0: ldc.i8 0x1 + IL_00b9: conv.i + IL_00ba: add + IL_00bb: div.un + IL_00bc: nop + IL_00bd: stloc.0 + IL_00be: sizeof [runtime]System.IntPtr + IL_00c4: ldc.i4.4 + IL_00c5: bne.un.s IL_00d7 + + IL_00c7: ldloc.0 + IL_00c8: ldc.i8 0xffffffff + IL_00d1: conv.u + IL_00d2: ceq + IL_00d4: nop + IL_00d5: br.s IL_00e5 + + IL_00d7: ldloc.0 + IL_00d8: ldc.i8 0xffffffffffffffff + IL_00e1: conv.u + IL_00e2: ceq + IL_00e4: nop + IL_00e5: brfalse.s IL_012a + + IL_00e7: ldc.i4.1 + IL_00e8: stloc.1 + IL_00e9: ldc.i8 0x0 + IL_00f2: conv.i + IL_00f3: stloc.2 + IL_00f4: ldc.i8 0x1 + IL_00fd: conv.i + IL_00fe: stloc.3 + IL_00ff: br.s IL_0126 + + IL_0101: ldloc.3 + IL_0102: call void assembly::set_c(native int) + IL_0107: ldloc.3 + IL_0108: ldarg.0 + IL_0109: add + IL_010a: stloc.3 + IL_010b: ldloc.2 + IL_010c: ldc.i8 0x1 + IL_0115: conv.i + IL_0116: add + IL_0117: stloc.2 + IL_0118: ldloc.2 + IL_0119: ldc.i8 0x0 + IL_0122: conv.i + IL_0123: cgt.un + IL_0125: stloc.1 + IL_0126: ldloc.1 + IL_0127: brtrue.s IL_0101 + + IL_0129: ret + + IL_012a: ldc.i8 0x0 + IL_0133: conv.i + IL_0134: ldarg.0 + IL_0135: bge.s IL_0182 + + IL_0137: ldc.i8 0xa + IL_0140: conv.i + IL_0141: ldc.i8 0x1 + IL_014a: conv.i + IL_014b: bge.s IL_015d + + IL_014d: ldc.i8 0x0 + IL_0156: conv.i + IL_0157: nop + IL_0158: br IL_01d4 + + IL_015d: ldc.i8 0xa + IL_0166: conv.i + IL_0167: ldc.i8 0x1 + IL_0170: conv.i + IL_0171: sub + IL_0172: ldarg.0 + IL_0173: div.un + IL_0174: ldc.i8 0x1 + IL_017d: conv.i + IL_017e: add.ovf.un + IL_017f: nop + IL_0180: br.s IL_01d4 + + IL_0182: ldc.i8 0x1 + IL_018b: conv.i + IL_018c: ldc.i8 0xa + IL_0195: conv.i + IL_0196: bge.s IL_01a5 + + IL_0198: ldc.i8 0x0 + IL_01a1: conv.i + IL_01a2: nop + IL_01a3: br.s IL_01d4 + + IL_01a5: ldc.i8 0x1 + IL_01ae: conv.i + IL_01af: ldc.i8 0xa + IL_01b8: conv.i + IL_01b9: sub + IL_01ba: ldarg.0 + IL_01bb: not + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add + IL_01c7: div.un + IL_01c8: ldc.i8 0x1 + IL_01d1: conv.i + IL_01d2: add.ovf.un + IL_01d3: nop + IL_01d4: stloc.2 + IL_01d5: ldc.i8 0x0 + IL_01de: conv.i + IL_01df: stloc.3 + IL_01e0: ldc.i8 0x1 + IL_01e9: conv.i + IL_01ea: stloc.s V_4 + IL_01ec: br.s IL_0208 + + IL_01ee: ldloc.s V_4 + IL_01f0: call void assembly::set_c(native int) + IL_01f5: ldloc.s V_4 + IL_01f7: ldarg.0 + IL_01f8: add + IL_01f9: stloc.s V_4 + IL_01fb: ldloc.3 + IL_01fc: ldc.i8 0x1 + IL_0205: conv.i + IL_0206: add + IL_0207: stloc.3 + IL_0208: ldloc.3 + IL_0209: ldloc.2 + IL_020a: blt.un.s IL_01ee + + IL_020c: ret + } + + .method public static void f9(native int finish) cil managed + { + + .maxstack 4 + .locals init (native int V_0, + native int V_1, + native int V_2) + 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_003d + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.i + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.i + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.i + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: stloc.1 + IL_0049: ldc.i8 0x1 + IL_0052: conv.i + IL_0053: stloc.2 + IL_0054: br.s IL_0076 + + IL_0056: ldloc.2 + IL_0057: call void assembly::set_c(native int) + IL_005c: ldloc.2 + IL_005d: ldc.i8 0x2 + IL_0066: conv.i + IL_0067: add + IL_0068: stloc.2 + IL_0069: ldloc.1 + IL_006a: ldc.i8 0x1 + IL_0073: conv.i + IL_0074: add + IL_0075: stloc.1 + IL_0076: ldloc.1 + IL_0077: ldloc.0 + IL_0078: blt.un.s IL_0056 + + IL_007a: ret + } + + .method public static void f10(native int start, + native int step, + native int finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .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: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: bne.un.s IL_0019 + + IL_000d: ldarg.2 + IL_000e: ldarg.1 + IL_000f: ldarg.2 + IL_0010: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0015: pop + IL_0016: nop + IL_0017: br.s IL_001a + + IL_0019: nop + IL_001a: ldc.i8 0x0 + IL_0023: conv.i + IL_0024: ldarg.1 + IL_0025: bge.s IL_0040 + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_0038 + + IL_002b: ldc.i8 0x0 + IL_0034: conv.i + IL_0035: nop + IL_0036: br.s IL_0063 + + IL_0038: ldarg.2 + IL_0039: ldarg.2 + IL_003a: sub + IL_003b: ldarg.1 + IL_003c: div.un + IL_003d: nop + IL_003e: br.s IL_0063 + + IL_0040: ldarg.2 + IL_0041: ldarg.2 + IL_0042: bge.s IL_0051 + + IL_0044: ldc.i8 0x0 + IL_004d: conv.i + IL_004e: nop + IL_004f: br.s IL_0063 + + IL_0051: ldarg.2 + IL_0052: ldarg.2 + IL_0053: sub + IL_0054: ldarg.1 + IL_0055: not + IL_0056: ldc.i8 0x1 + IL_005f: conv.i + IL_0060: add + IL_0061: div.un + IL_0062: nop + IL_0063: stloc.0 + IL_0064: sizeof [runtime]System.IntPtr + IL_006a: ldc.i4.4 + IL_006b: bne.un.s IL_007d + + IL_006d: ldloc.0 + IL_006e: ldc.i8 0xffffffff + IL_0077: conv.u + IL_0078: ceq + IL_007a: nop + IL_007b: br.s IL_008b + + IL_007d: ldloc.0 + IL_007e: ldc.i8 0xffffffffffffffff + IL_0087: conv.u + IL_0088: ceq + IL_008a: nop + IL_008b: brfalse.s IL_00c7 + + IL_008d: ldc.i4.1 + IL_008e: stloc.1 + IL_008f: ldc.i8 0x0 + IL_0098: conv.i + IL_0099: stloc.2 + IL_009a: ldarg.2 + IL_009b: stloc.3 + IL_009c: br.s IL_00c3 + + IL_009e: ldloc.3 + IL_009f: call void assembly::set_c(native int) + IL_00a4: ldloc.3 + IL_00a5: ldarg.1 + IL_00a6: add + IL_00a7: stloc.3 + IL_00a8: ldloc.2 + IL_00a9: ldc.i8 0x1 + IL_00b2: conv.i + IL_00b3: add + IL_00b4: stloc.2 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x0 + IL_00bf: conv.i + IL_00c0: cgt.un + IL_00c2: stloc.1 + IL_00c3: ldloc.1 + IL_00c4: brtrue.s IL_009e + + IL_00c6: ret + + IL_00c7: ldc.i8 0x0 + IL_00d0: conv.i + IL_00d1: ldarg.1 + IL_00d2: bge.s IL_00f8 + + IL_00d4: ldarg.2 + IL_00d5: ldarg.2 + IL_00d6: bge.s IL_00e5 + + IL_00d8: ldc.i8 0x0 + IL_00e1: conv.i + IL_00e2: nop + IL_00e3: br.s IL_0126 + + IL_00e5: ldarg.2 + IL_00e6: ldarg.2 + IL_00e7: sub + IL_00e8: ldarg.1 + IL_00e9: div.un + IL_00ea: ldc.i8 0x1 + IL_00f3: conv.i + IL_00f4: add.ovf.un + IL_00f5: nop + IL_00f6: br.s IL_0126 + + IL_00f8: ldarg.2 + IL_00f9: ldarg.2 + IL_00fa: bge.s IL_0109 + + IL_00fc: ldc.i8 0x0 + IL_0105: conv.i + IL_0106: nop + IL_0107: br.s IL_0126 + + IL_0109: ldarg.2 + IL_010a: ldarg.2 + IL_010b: sub + IL_010c: ldarg.1 + IL_010d: not + IL_010e: ldc.i8 0x1 + IL_0117: conv.i + IL_0118: add + IL_0119: div.un + IL_011a: ldc.i8 0x1 + IL_0123: conv.i + IL_0124: add.ovf.un + IL_0125: nop + IL_0126: stloc.2 + IL_0127: ldc.i8 0x0 + IL_0130: conv.i + IL_0131: stloc.3 + IL_0132: ldarg.2 + IL_0133: stloc.s V_4 + IL_0135: br.s IL_0151 + + IL_0137: ldloc.s V_4 + IL_0139: call void assembly::set_c(native int) + IL_013e: ldloc.s V_4 + IL_0140: ldarg.1 + IL_0141: add + IL_0142: stloc.s V_4 + IL_0144: ldloc.3 + IL_0145: ldc.i8 0x1 + IL_014e: conv.i + IL_014f: add + IL_0150: stloc.3 + IL_0151: ldloc.3 + IL_0152: ldloc.2 + IL_0153: blt.un.s IL_0137 + + IL_0155: ret + } + + .method public static void f11(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 5 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.i + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0011: pop + IL_0012: ldc.i8 0x0 + IL_001b: conv.i + IL_001c: stloc.0 + IL_001d: ldc.i8 0x0 + IL_0026: conv.i + IL_0027: stloc.1 + IL_0028: ldarg.0 + IL_0029: stloc.2 + IL_002a: br.s IL_004c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(native int) + IL_0032: ldloc.2 + IL_0033: ldc.i8 0x0 + IL_003c: conv.i + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i8 0x1 + IL_0049: conv.i + IL_004a: add + IL_004b: stloc.1 + IL_004c: ldloc.1 + IL_004d: ldloc.0 + IL_004e: blt.un.s IL_002c + + IL_0050: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (native int V_0, + native int V_1, + native int V_2) + IL_0000: ldc.i8 0x1 + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: ldc.i8 0xa + IL_001d: conv.i + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0023: pop + IL_0024: ldc.i8 0x0 + IL_002d: conv.i + IL_002e: stloc.0 + IL_002f: ldc.i8 0x0 + IL_0038: conv.i + IL_0039: stloc.1 + IL_003a: ldc.i8 0x1 + IL_0043: conv.i + IL_0044: stloc.2 + IL_0045: br.s IL_0067 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(native int) + IL_004d: ldloc.2 + IL_004e: ldc.i8 0x0 + IL_0057: conv.i + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.1 + IL_005b: ldc.i8 0x1 + IL_0064: conv.i + IL_0065: add + IL_0066: stloc.1 + IL_0067: ldloc.1 + IL_0068: ldloc.0 + IL_0069: blt.un.s IL_0047 + + IL_006b: ret + } + + .method public static void f13() 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 f14() cil managed + { + + .maxstack 5 + .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 0xfffffffffffffffe + IL_0009: conv.i + IL_000a: ldc.i8 0x0 + IL_0013: conv.i + IL_0014: bne.un.s IL_003d + + IL_0016: ldc.i8 0xa + IL_001f: conv.i + IL_0020: ldc.i8 0xfffffffffffffffe + IL_0029: conv.i + IL_002a: ldc.i8 0x1 + IL_0033: conv.i + IL_0034: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeIntPtr(native int, + native int, + native int) + IL_0039: pop + IL_003a: nop + IL_003b: br.s IL_003e + + IL_003d: nop + IL_003e: ldc.i8 0x0 + IL_0047: conv.i + IL_0048: ldc.i8 0xfffffffffffffffe + IL_0051: conv.i + IL_0052: bge.s IL_009a + + IL_0054: ldc.i8 0x1 + IL_005d: conv.i + IL_005e: ldc.i8 0xa + IL_0067: conv.i + IL_0068: bge.s IL_0077 + + IL_006a: ldc.i8 0x0 + IL_0073: conv.i + IL_0074: nop + IL_0075: br.s IL_00ea + + IL_0077: ldc.i8 0x1 + IL_0080: conv.i + IL_0081: ldc.i8 0xa + IL_008a: conv.i + IL_008b: sub + IL_008c: ldc.i8 0xfffffffffffffffe + IL_0095: conv.i + IL_0096: div.un + IL_0097: nop + IL_0098: br.s IL_00ea + + IL_009a: ldc.i8 0xa + IL_00a3: conv.i + IL_00a4: ldc.i8 0x1 + IL_00ad: conv.i + IL_00ae: bge.s IL_00bd + + IL_00b0: ldc.i8 0x0 + IL_00b9: conv.i + IL_00ba: nop + IL_00bb: br.s IL_00ea + + IL_00bd: ldc.i8 0xa + IL_00c6: conv.i + IL_00c7: ldc.i8 0x1 + IL_00d0: conv.i + IL_00d1: sub + IL_00d2: ldc.i8 0xfffffffffffffffe + IL_00db: conv.i + IL_00dc: not + IL_00dd: ldc.i8 0x1 + IL_00e6: conv.i + IL_00e7: add + IL_00e8: div.un + IL_00e9: nop + IL_00ea: stloc.0 + IL_00eb: sizeof [runtime]System.IntPtr + IL_00f1: ldc.i4.4 + IL_00f2: bne.un.s IL_0104 + + IL_00f4: ldloc.0 + IL_00f5: ldc.i8 0xffffffff + IL_00fe: conv.u + IL_00ff: ceq + IL_0101: nop + IL_0102: br.s IL_0112 + + IL_0104: ldloc.0 + IL_0105: ldc.i8 0xffffffffffffffff + IL_010e: conv.u + IL_010f: ceq + IL_0111: nop + IL_0112: brfalse.s IL_0160 + + IL_0114: ldc.i4.1 + IL_0115: stloc.1 + IL_0116: ldc.i8 0x0 + IL_011f: conv.i + IL_0120: stloc.2 + IL_0121: ldc.i8 0xa + IL_012a: conv.i + IL_012b: stloc.3 + IL_012c: br.s IL_015c + + IL_012e: ldloc.3 + IL_012f: call void assembly::set_c(native int) + IL_0134: ldloc.3 + IL_0135: ldc.i8 0xfffffffffffffffe + IL_013e: conv.i + IL_013f: add + IL_0140: stloc.3 + IL_0141: ldloc.2 + IL_0142: ldc.i8 0x1 + IL_014b: conv.i + IL_014c: add + IL_014d: stloc.2 + IL_014e: ldloc.2 + IL_014f: ldc.i8 0x0 + IL_0158: conv.i + IL_0159: cgt.un + IL_015b: stloc.1 + IL_015c: ldloc.1 + IL_015d: brtrue.s IL_012e + + IL_015f: ret + + IL_0160: ldc.i8 0x0 + IL_0169: conv.i + IL_016a: ldc.i8 0xfffffffffffffffe + IL_0173: conv.i + IL_0174: bge.s IL_01ca + + IL_0176: ldc.i8 0x1 + IL_017f: conv.i + IL_0180: ldc.i8 0xa + IL_0189: conv.i + IL_018a: bge.s IL_019c + + IL_018c: ldc.i8 0x0 + IL_0195: conv.i + IL_0196: nop + IL_0197: br IL_0225 + + IL_019c: ldc.i8 0x1 + IL_01a5: conv.i + IL_01a6: ldc.i8 0xa + IL_01af: conv.i + IL_01b0: sub + IL_01b1: ldc.i8 0xfffffffffffffffe + IL_01ba: conv.i + IL_01bb: div.un + IL_01bc: ldc.i8 0x1 + IL_01c5: conv.i + IL_01c6: add.ovf.un + IL_01c7: nop + IL_01c8: br.s IL_0225 + + IL_01ca: ldc.i8 0xa + IL_01d3: conv.i + IL_01d4: ldc.i8 0x1 + IL_01dd: conv.i + IL_01de: bge.s IL_01ed + + IL_01e0: ldc.i8 0x0 + IL_01e9: conv.i + IL_01ea: nop + IL_01eb: br.s IL_0225 + + IL_01ed: ldc.i8 0xa + IL_01f6: conv.i + IL_01f7: ldc.i8 0x1 + IL_0200: conv.i + IL_0201: sub + IL_0202: ldc.i8 0xfffffffffffffffe + IL_020b: conv.i + IL_020c: not + IL_020d: ldc.i8 0x1 + IL_0216: conv.i + IL_0217: add + IL_0218: div.un + IL_0219: ldc.i8 0x1 + IL_0222: conv.i + IL_0223: add.ovf.un + IL_0224: nop + IL_0225: stloc.2 + IL_0226: ldc.i8 0x0 + IL_022f: conv.i + IL_0230: stloc.3 + IL_0231: ldc.i8 0xa + IL_023a: conv.i + IL_023b: stloc.s V_4 + IL_023d: br.s IL_0262 + + IL_023f: ldloc.s V_4 + IL_0241: call void assembly::set_c(native int) + IL_0246: ldloc.s V_4 + IL_0248: ldc.i8 0xfffffffffffffffe + IL_0251: conv.i + IL_0252: add + IL_0253: stloc.s V_4 + IL_0255: ldloc.3 + IL_0256: ldc.i8 0x1 + IL_025f: conv.i + IL_0260: add + IL_0261: stloc.3 + IL_0262: ldloc.3 + IL_0263: ldloc.2 + IL_0264: blt.un.s IL_023f + + IL_0266: 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/RealInternalSignatureOn/ForEachRangeStepSByte.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepSByte.fs new file mode 100644 index 00000000000..ee96ee45237 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepSByte.fs @@ -0,0 +1,65 @@ +let mutable c = 0y + +let f0 () = + for n in 10y..1y do + c <- n + +let f00 () = + for n in 10y..1y..1y do + c <- n + +let f1 () = + for n in 1y..10y do + c <- n + +let f2 start = + for n in start..10y do + c <- n + +let f3 finish = + for n in 1y..finish do + c <- n + +let f4 (start: sbyte) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1y..1y..10y do + c <- n + +let f6 () = + for n in 1y..2y..10y do + c <- n + +let f7 start = + for n in start..2y..10y do + c <- n + +let f8 step = + for n in 1y..step..10y do + c <- n + +let f9 finish = + for n in 1y..2y..finish do + c <- n + +let f10 (start: sbyte) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0y..finish do + c <- n + +let f12 () = + for n in 1y..0y..10y do + c <- n + +let f13 () = + for n in 10y .. -1y .. 1y do + c <- n + +let f14 () = + for n in 10y .. -2y .. 1y do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepSByte.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepSByte.fs.opt.il.bsl new file mode 100644 index 00000000000..6ade092cfe6 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepSByte.fs.opt.il.bsl @@ -0,0 +1,786 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.i2 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(int8) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(int8 step) cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.0 + IL_0012: ldarg.0 + IL_0013: bge.s IL_001f + + IL_0015: ldc.i4.s 9 + IL_0017: ldarg.0 + IL_0018: div.un + IL_0019: conv.i2 + IL_001a: ldc.i4.1 + IL_001b: add + IL_001c: nop + IL_001d: br.s IL_0021 + + IL_001f: ldc.i4.0 + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldc.i4.1 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(int8) + IL_002e: ldloc.2 + IL_002f: ldarg.0 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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.1 + 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.2 + 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 f10(int8 start, + int8 step, + int8 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + int8 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldc.i4.0 + IL_0011: ldarg.1 + IL_0012: bge.s IL_0027 + + IL_0014: ldarg.2 + IL_0015: ldarg.2 + IL_0016: bge.s IL_001c + + IL_0018: ldc.i4.0 + IL_0019: nop + IL_001a: br.s IL_003b + + IL_001c: ldarg.2 + IL_001d: ldarg.2 + IL_001e: sub + IL_001f: ldarg.1 + IL_0020: div.un + IL_0021: conv.i2 + IL_0022: ldc.i4.1 + IL_0023: add + IL_0024: nop + IL_0025: br.s IL_003b + + IL_0027: ldarg.2 + IL_0028: ldarg.2 + IL_0029: bge.s IL_002f + + IL_002b: ldc.i4.0 + IL_002c: nop + IL_002d: br.s IL_003b + + IL_002f: ldarg.2 + IL_0030: ldarg.2 + IL_0031: sub + IL_0032: ldarg.1 + IL_0033: not + IL_0034: ldc.i4.1 + IL_0035: add + IL_0036: div.un + IL_0037: conv.i2 + IL_0038: ldc.i4.1 + IL_0039: add + IL_003a: nop + IL_003b: stloc.0 + IL_003c: ldc.i4.0 + IL_003d: stloc.1 + IL_003e: ldarg.2 + IL_003f: stloc.2 + IL_0040: br.s IL_0050 + + IL_0042: ldloc.2 + IL_0043: call void assembly::set_c(int8) + IL_0048: ldloc.2 + IL_0049: ldarg.1 + IL_004a: add + IL_004b: stloc.2 + IL_004c: ldloc.1 + IL_004d: ldc.i4.1 + IL_004e: add + IL_004f: stloc.1 + IL_0050: ldloc.1 + IL_0051: ldloc.0 + IL_0052: blt.un.s IL_0042 + + IL_0054: ret + } + + .method public static void f11(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 5 + .locals init (int8 V_0, + int8 V_1, + int8 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(int8) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (int8 V_0, + int8 V_1, + int8 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeSByte(int8, + int8, + int8) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(int8) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: ret + } + + .method public static void f13() 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 f14() 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_0016 + + IL_0007: ldloc.1 + IL_0008: call void assembly::set_c(int8) + IL_000d: ldloc.1 + IL_000e: ldc.i4.s -2 + IL_0010: add + IL_0011: stloc.1 + IL_0012: ldloc.0 + IL_0013: ldc.i4.1 + IL_0014: add + IL_0015: stloc.0 + IL_0016: ldloc.0 + IL_0017: ldc.i4.5 + IL_0018: blt.un.s IL_0007 + + IL_001a: 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/RealInternalSignatureOn/ForEachRangeStepUInt16.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt16.fs new file mode 100644 index 00000000000..64028b65394 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt16.fs @@ -0,0 +1,57 @@ +let mutable c = 0us + +let f0 () = + for n in 10us..1us do + c <- n + +let f00 () = + for n in 10us..1us..1us do + c <- n + +let f1 () = + for n in 1us..10us do + c <- n + +let f2 start = + for n in start..10us do + c <- n + +let f3 finish = + for n in 1us..finish do + c <- n + +let f4 (start: uint16) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1us..1us..10us do + c <- n + +let f6 () = + for n in 1us..2us..10us do + c <- n + +let f7 start = + for n in start..2us..10us do + c <- n + +let f8 step = + for n in 1us..step..10us do + c <- n + +let f9 finish = + for n in 1us..2us..finish do + c <- n + +let f10 (start: uint16) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0us..finish do + c <- n + +let f12 () = + for n in 1us..0us..10us do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt16.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt16.fs.opt.il.bsl new file mode 100644 index 00000000000..0ef1855e8d8 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt16.fs.opt.il.bsl @@ -0,0 +1,693 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0016: blt.un.s IL_0006 + + IL_0018: ret + } + + .method public static void f7(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_0013 + + IL_0009: ldc.i4.s 10 + IL_000b: ldarg.0 + IL_000c: sub + IL_000d: ldc.i4.2 + IL_000e: div.un + IL_000f: conv.u4 + IL_0010: ldc.i4.1 + IL_0011: add + IL_0012: nop + IL_0013: stloc.0 + IL_0014: ldc.i4.0 + IL_0015: stloc.1 + IL_0016: ldarg.0 + IL_0017: stloc.2 + IL_0018: br.s IL_0028 + + IL_001a: ldloc.2 + IL_001b: call void assembly::set_c(uint16) + IL_0020: ldloc.2 + IL_0021: ldc.i4.2 + IL_0022: add + IL_0023: stloc.2 + IL_0024: ldloc.1 + IL_0025: ldc.i4.1 + IL_0026: add + IL_0027: stloc.1 + IL_0028: ldloc.1 + IL_0029: ldloc.0 + IL_002a: blt.un.s IL_001a + + IL_002c: ret + } + + .method public static void f8(uint16 step) cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u4 + IL_0016: ldc.i4.1 + IL_0017: add + IL_0018: stloc.0 + IL_0019: ldc.i4.0 + IL_001a: stloc.1 + IL_001b: ldc.i4.1 + IL_001c: stloc.2 + IL_001d: br.s IL_002d + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint16) + IL_0025: ldloc.2 + IL_0026: ldarg.0 + IL_0027: add + IL_0028: stloc.2 + IL_0029: ldloc.1 + IL_002a: ldc.i4.1 + IL_002b: add + IL_002c: stloc.1 + IL_002d: ldloc.1 + IL_002e: ldloc.0 + IL_002f: blt.un.s IL_001f + + IL_0031: ret + } + + .method public static void f9(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_0011 + + IL_0008: ldarg.0 + IL_0009: ldc.i4.1 + IL_000a: sub + IL_000b: ldc.i4.2 + IL_000c: div.un + 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.1 + 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.2 + 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 f10(uint16 start, + uint16 step, + uint16 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint16 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0018 + + IL_0014: ldc.i4.0 + IL_0015: nop + IL_0016: br.s IL_0021 + + IL_0018: ldarg.2 + IL_0019: ldarg.2 + IL_001a: sub + IL_001b: ldarg.1 + IL_001c: div.un + IL_001d: conv.u4 + IL_001e: ldc.i4.1 + IL_001f: add + IL_0020: nop + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.1 + IL_0024: ldarg.2 + IL_0025: stloc.2 + IL_0026: br.s IL_0036 + + IL_0028: ldloc.2 + IL_0029: call void assembly::set_c(uint16) + IL_002e: ldloc.2 + IL_002f: ldarg.1 + IL_0030: add + IL_0031: stloc.2 + IL_0032: ldloc.1 + IL_0033: ldc.i4.1 + IL_0034: add + IL_0035: stloc.1 + IL_0036: ldloc.1 + IL_0037: ldloc.0 + IL_0038: blt.un.s IL_0028 + + IL_003a: ret + } + + .method public static void f11(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 5 + .locals init (uint16 V_0, + uint16 V_1, + uint16 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint16) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint16 V_0, + uint16 V_1, + uint16 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt16(uint16, + uint16, + uint16) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint16) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: 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/RealInternalSignatureOn/ForEachRangeStepUInt32.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt32.fs new file mode 100644 index 00000000000..d689d8d393a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt32.fs @@ -0,0 +1,57 @@ +let mutable c = 0u + +let f0 () = + for n in 10u..1u do + c <- n + +let f00 () = + for n in 10u..1u..1u do + c <- n + +let f1 () = + for n in 1u..10u do + c <- n + +let f2 start = + for n in start..10u do + c <- n + +let f3 finish = + for n in 1u..finish do + c <- n + +let f4 (start: uint32) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1u..1u..10u do + c <- n + +let f6 () = + for n in 1u..2u..10u do + c <- n + +let f7 start = + for n in start..2u..10u do + c <- n + +let f8 step = + for n in 1u..step..10u do + c <- n + +let f9 finish = + for n in 1u..2u..finish do + c <- n + +let f10 (start: uint32) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0u..finish do + c <- n + +let f12 () = + for n in 1u..0u..10u do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt32.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt32.fs.opt.il.bsl new file mode 100644 index 00000000000..80285c89dc2 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt32.fs.opt.il.bsl @@ -0,0 +1,729 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_0018: conv.i8 + IL_0019: blt.un.s IL_0007 + + IL_001b: ret + } + + .method public static void f7(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_0015 + + IL_000a: ldc.i4.s 10 + IL_000c: ldarg.0 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: div.un + IL_0010: conv.u8 + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldarg.0 + IL_001a: stloc.2 + IL_001b: br.s IL_002c + + IL_001d: ldloc.2 + IL_001e: call void assembly::set_c(uint32) + IL_0023: ldloc.2 + IL_0024: ldc.i4.2 + 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_001d + + IL_0030: ret + } + + .method public static void f8(uint32 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0010 + + IL_0003: ldc.i4.1 + IL_0004: ldarg.0 + IL_0005: ldc.i4.s 10 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_000c: pop + IL_000d: nop + IL_000e: br.s IL_0011 + + IL_0010: nop + IL_0011: ldc.i4.s 9 + IL_0013: ldarg.0 + IL_0014: div.un + IL_0015: conv.u8 + IL_0016: ldc.i4.1 + IL_0017: conv.i8 + IL_0018: add + IL_0019: stloc.0 + IL_001a: ldc.i4.0 + IL_001b: conv.i8 + IL_001c: stloc.1 + IL_001d: ldc.i4.1 + IL_001e: stloc.2 + IL_001f: br.s IL_0030 + + IL_0021: ldloc.2 + IL_0022: call void assembly::set_c(uint32) + IL_0027: ldloc.2 + IL_0028: ldarg.0 + IL_0029: add + IL_002a: stloc.2 + IL_002b: ldloc.1 + IL_002c: ldc.i4.1 + IL_002d: conv.i8 + IL_002e: add + IL_002f: stloc.1 + IL_0030: ldloc.1 + IL_0031: ldloc.0 + IL_0032: blt.un.s IL_0021 + + IL_0034: ret + } + + .method public static void f9(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_0013 + + IL_0009: ldarg.0 + IL_000a: ldc.i4.1 + IL_000b: sub + IL_000c: ldc.i4.2 + IL_000d: div.un + 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: ldc.i4.1 + 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.2 + 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 f10(uint32 start, + uint32 step, + uint32 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint32 V_2) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_0023 + + IL_0019: ldarg.2 + IL_001a: ldarg.2 + IL_001b: sub + IL_001c: ldarg.1 + IL_001d: div.un + IL_001e: conv.u8 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: add + IL_0022: nop + IL_0023: stloc.0 + IL_0024: ldc.i4.0 + IL_0025: conv.i8 + IL_0026: stloc.1 + IL_0027: ldarg.2 + IL_0028: stloc.2 + IL_0029: br.s IL_003a + + IL_002b: ldloc.2 + IL_002c: call void assembly::set_c(uint32) + IL_0031: ldloc.2 + IL_0032: ldarg.1 + IL_0033: add + IL_0034: stloc.2 + IL_0035: ldloc.1 + IL_0036: ldc.i4.1 + IL_0037: conv.i8 + IL_0038: add + IL_0039: stloc.1 + IL_003a: ldloc.1 + IL_003b: ldloc.0 + IL_003c: blt.un.s IL_002b + + IL_003e: ret + } + + .method public static void f11(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 5 + .locals init (uint32 V_0, + uint32 V_1, + uint32 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: ldarg.1 + IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_0008: pop + IL_0009: ldc.i4.0 + IL_000a: stloc.0 + IL_000b: ldc.i4.0 + IL_000c: stloc.1 + IL_000d: ldarg.0 + IL_000e: stloc.2 + IL_000f: br.s IL_001f + + IL_0011: ldloc.2 + IL_0012: call void assembly::set_c(uint32) + IL_0017: ldloc.2 + IL_0018: ldc.i4.0 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.1 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.1 + IL_001f: ldloc.1 + IL_0020: ldloc.0 + IL_0021: blt.un.s IL_0011 + + IL_0023: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint32 V_0, + uint32 V_1, + uint32 V_2) + IL_0000: ldc.i4.1 + IL_0001: ldc.i4.0 + IL_0002: ldc.i4.s 10 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt32(uint32, + uint32, + uint32) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: stloc.0 + IL_000c: ldc.i4.0 + IL_000d: stloc.1 + IL_000e: ldc.i4.1 + IL_000f: stloc.2 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.2 + IL_0013: call void assembly::set_c(uint32) + IL_0018: ldloc.2 + IL_0019: ldc.i4.0 + IL_001a: add + IL_001b: stloc.2 + IL_001c: ldloc.1 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.1 + IL_0020: ldloc.1 + IL_0021: ldloc.0 + IL_0022: blt.un.s IL_0012 + + IL_0024: 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/RealInternalSignatureOn/ForEachRangeStepUInt64.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs new file mode 100644 index 00000000000..2a9b1627344 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs @@ -0,0 +1,57 @@ +let mutable c = 0UL + +let f0 () = + for n in 10UL..1UL do + c <- n + +let f00 () = + for n in 10UL..1UL..1UL do + c <- n + +let f1 () = + for n in 1UL..10UL do + c <- n + +let f2 start = + for n in start..10UL do + c <- n + +let f3 finish = + for n in 1UL..finish do + c <- n + +let f4 (start: uint64) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1UL..1UL..10UL do + c <- n + +let f6 () = + for n in 1UL..2UL..10UL do + c <- n + +let f7 start = + for n in start..2UL..10UL do + c <- n + +let f8 step = + for n in 1UL..step..10UL do + c <- n + +let f9 finish = + for n in 1UL..2UL..finish do + c <- n + +let f10 (start: uint64) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0UL..finish do + c <- n + +let f12 () = + for n in 1UL..0UL..10UL do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl new file mode 100644 index 00000000000..96c418afb00 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUInt64.fs.opt.il.bsl @@ -0,0 +1,878 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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.2 + 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.5 + IL_001a: conv.i8 + IL_001b: blt.un.s IL_0008 + + IL_001d: ret + } + + .method public static void f7(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_0017 + + IL_000b: ldc.i4.s 10 + IL_000d: conv.i8 + IL_000e: ldarg.0 + IL_000f: sub + IL_0010: ldc.i4.2 + IL_0011: conv.i8 + IL_0012: div.un + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: add.ovf.un + IL_0016: nop + IL_0017: stloc.0 + IL_0018: ldc.i4.0 + IL_0019: conv.i8 + IL_001a: stloc.1 + IL_001b: ldarg.0 + IL_001c: stloc.2 + IL_001d: br.s IL_002f + + IL_001f: ldloc.2 + IL_0020: call void assembly::set_c(uint64) + IL_0025: ldloc.2 + IL_0026: ldc.i4.2 + IL_0027: conv.i8 + IL_0028: add + IL_0029: stloc.2 + IL_002a: ldloc.1 + IL_002b: ldc.i4.1 + IL_002c: conv.i8 + IL_002d: add + IL_002e: stloc.1 + IL_002f: ldloc.1 + IL_0030: ldloc.0 + IL_0031: blt.un.s IL_001f + + IL_0033: ret + } + + .method public static void f8(uint64 step) cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: brtrue.s IL_0012 + + IL_0003: ldc.i4.1 + IL_0004: conv.i8 + IL_0005: ldarg.0 + IL_0006: ldc.i4.s 10 + IL_0008: conv.i8 + IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000e: pop + IL_000f: nop + IL_0010: br.s IL_0013 + + IL_0012: nop + IL_0013: ldc.i4.s 9 + IL_0015: conv.i8 + IL_0016: ldarg.0 + IL_0017: div.un + IL_0018: ldc.i4.1 + IL_0019: conv.i8 + IL_001a: add.ovf.un + IL_001b: stloc.0 + IL_001c: ldc.i4.0 + IL_001d: conv.i8 + IL_001e: stloc.1 + IL_001f: ldc.i4.1 + IL_0020: conv.i8 + IL_0021: stloc.2 + IL_0022: br.s IL_0033 + + IL_0024: ldloc.2 + IL_0025: call void assembly::set_c(uint64) + IL_002a: ldloc.2 + IL_002b: ldarg.0 + IL_002c: add + IL_002d: stloc.2 + IL_002e: ldloc.1 + IL_002f: ldc.i4.1 + IL_0030: conv.i8 + IL_0031: add + IL_0032: stloc.1 + IL_0033: ldloc.1 + IL_0034: ldloc.0 + IL_0035: blt.un.s IL_0024 + + IL_0037: ret + } + + .method public static void f9(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_0015 + + IL_000a: ldarg.0 + IL_000b: ldc.i4.1 + IL_000c: conv.i8 + IL_000d: sub + IL_000e: ldc.i4.2 + IL_000f: conv.i8 + IL_0010: div.un + IL_0011: ldc.i4.1 + IL_0012: conv.i8 + IL_0013: add.ovf.un + IL_0014: nop + IL_0015: stloc.0 + IL_0016: ldc.i4.0 + IL_0017: conv.i8 + IL_0018: stloc.1 + IL_0019: ldc.i4.1 + 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(uint64) + IL_0024: ldloc.2 + IL_0025: ldc.i4.2 + 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 f10(uint64 start, + uint64 step, + uint64 finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .locals init (uint64 V_0, + bool V_1, + uint64 V_2, + uint64 V_3, + uint64 V_4) + IL_0000: ldarg.1 + IL_0001: brtrue.s IL_000f + + IL_0003: ldarg.2 + IL_0004: ldarg.1 + IL_0005: ldarg.2 + IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000b: pop + IL_000c: nop + IL_000d: br.s IL_0010 + + IL_000f: nop + IL_0010: ldarg.2 + IL_0011: ldarg.2 + IL_0012: bge.un.s IL_0019 + + IL_0014: ldc.i4.0 + IL_0015: conv.i8 + IL_0016: nop + IL_0017: br.s IL_001f + + IL_0019: ldarg.2 + IL_001a: ldarg.2 + IL_001b: sub + IL_001c: ldarg.1 + IL_001d: div.un + IL_001e: nop + IL_001f: stloc.0 + IL_0020: ldloc.0 + IL_0021: ldc.i4.m1 + IL_0022: conv.i8 + IL_0023: bne.un.s IL_0047 + + IL_0025: ldc.i4.1 + IL_0026: stloc.1 + IL_0027: ldc.i4.0 + IL_0028: conv.i8 + IL_0029: stloc.2 + IL_002a: ldarg.2 + IL_002b: stloc.3 + IL_002c: br.s IL_0043 + + IL_002e: ldloc.3 + IL_002f: call void assembly::set_c(uint64) + IL_0034: ldloc.3 + IL_0035: ldarg.1 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.2 + IL_0039: ldc.i4.1 + IL_003a: conv.i8 + IL_003b: add + IL_003c: stloc.2 + IL_003d: ldloc.2 + IL_003e: ldc.i4.0 + IL_003f: conv.i8 + IL_0040: cgt.un + IL_0042: stloc.1 + IL_0043: ldloc.1 + IL_0044: brtrue.s IL_002e + + IL_0046: ret + + IL_0047: ldarg.2 + IL_0048: ldarg.2 + IL_0049: bge.un.s IL_0050 + + IL_004b: ldc.i4.0 + IL_004c: conv.i8 + IL_004d: nop + IL_004e: br.s IL_0059 + + IL_0050: ldarg.2 + IL_0051: ldarg.2 + IL_0052: sub + IL_0053: ldarg.1 + IL_0054: div.un + IL_0055: ldc.i4.1 + IL_0056: conv.i8 + IL_0057: add.ovf.un + IL_0058: nop + IL_0059: stloc.2 + IL_005a: ldc.i4.0 + IL_005b: conv.i8 + IL_005c: stloc.3 + IL_005d: ldarg.2 + IL_005e: stloc.s V_4 + IL_0060: br.s IL_0074 + + IL_0062: ldloc.s V_4 + IL_0064: call void assembly::set_c(uint64) + IL_0069: ldloc.s V_4 + IL_006b: ldarg.1 + IL_006c: add + IL_006d: stloc.s V_4 + IL_006f: ldloc.3 + IL_0070: ldc.i4.1 + IL_0071: conv.i8 + IL_0072: add + IL_0073: stloc.3 + IL_0074: ldloc.3 + IL_0075: ldloc.2 + IL_0076: blt.un.s IL_0062 + + IL_0078: ret + } + + .method public static void f11(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 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i4.0 + IL_0002: conv.i8 + IL_0003: ldarg.1 + IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_0009: pop + IL_000a: ldc.i4.0 + IL_000b: conv.i8 + IL_000c: stloc.0 + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.1 + IL_0010: ldarg.0 + IL_0011: stloc.2 + IL_0012: br.s IL_0024 + + IL_0014: ldloc.2 + IL_0015: call void assembly::set_c(uint64) + IL_001a: ldloc.2 + IL_001b: ldc.i4.0 + IL_001c: conv.i8 + IL_001d: add + IL_001e: stloc.2 + IL_001f: ldloc.1 + IL_0020: ldc.i4.1 + IL_0021: conv.i8 + IL_0022: add + IL_0023: stloc.1 + IL_0024: ldloc.1 + IL_0025: ldloc.0 + IL_0026: blt.un.s IL_0014 + + IL_0028: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (uint64 V_0, + uint64 V_1, + uint64 V_2) + IL_0000: ldc.i4.1 + IL_0001: conv.i8 + IL_0002: ldc.i4.0 + IL_0003: conv.i8 + IL_0004: ldc.i4.s 10 + IL_0006: conv.i8 + IL_0007: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUInt64(uint64, + uint64, + uint64) + IL_000c: pop + IL_000d: ldc.i4.0 + IL_000e: conv.i8 + IL_000f: stloc.0 + IL_0010: ldc.i4.0 + IL_0011: conv.i8 + IL_0012: stloc.1 + IL_0013: ldc.i4.1 + IL_0014: conv.i8 + IL_0015: stloc.2 + IL_0016: br.s IL_0028 + + IL_0018: ldloc.2 + IL_0019: call void assembly::set_c(uint64) + IL_001e: ldloc.2 + IL_001f: ldc.i4.0 + IL_0020: conv.i8 + 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_0018 + + IL_002c: 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/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs new file mode 100644 index 00000000000..0ec7970c52a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs @@ -0,0 +1,57 @@ +let mutable c = 0un + +let f0 () = + for n in 10un..1un do + c <- n + +let f00 () = + for n in 10un..1un..1un do + c <- n + +let f1 () = + for n in 1un..10un do + c <- n + +let f2 start = + for n in start..10un do + c <- n + +let f3 finish = + for n in 1un..finish do + c <- n + +let f4 (start: unativeint) finish = + for n in start..finish do + c <- n + +let f5 () = + for n in 1un..1un..10un do + c <- n + +let f6 () = + for n in 1un..2un..10un do + c <- n + +let f7 start = + for n in start..2un..10un do + c <- n + +let f8 step = + for n in 1un..step..10un do + c <- n + +let f9 finish = + for n in 1un..2un..finish do + c <- n + +let f10 (start: unativeint) step finish = + for n in finish..step..finish do + c <- n + +let f11 start finish = + for n in start..0un..finish do + c <- n + +let f12 () = + for n in 1un..0un..10un do + c <- n diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl new file mode 100644 index 00000000000..394330583c9 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForEachRangeStepUIntPtr.fs.opt.il.bsl @@ -0,0 +1,1129 @@ + + + + + +.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 +} +.mresource public FSharpSignatureData.assembly +{ + + +} +.mresource public FSharpOptimizationData.assembly +{ + + +} +.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 ) + .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 public static void f0() 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 f00() 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 f1() 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 f2(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 f3(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 f4(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 f5() 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 f6() 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 0x2 + 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 0x5 + IL_0042: conv.u + IL_0043: blt.un.s IL_0018 + + IL_0045: ret + } + + .method public static void f7(native uint start) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + 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_003d + + IL_001a: ldc.i8 0xa + IL_0023: conv.u + IL_0024: ldarg.0 + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.u + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.u + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.u + IL_0048: stloc.1 + IL_0049: ldarg.0 + IL_004a: stloc.2 + IL_004b: br.s IL_006d + + IL_004d: ldloc.2 + IL_004e: call void assembly::set_c(native uint) + IL_0053: ldloc.2 + IL_0054: ldc.i8 0x2 + IL_005d: conv.u + IL_005e: add + IL_005f: stloc.2 + IL_0060: ldloc.1 + IL_0061: ldc.i8 0x1 + IL_006a: conv.u + IL_006b: add + IL_006c: stloc.1 + IL_006d: ldloc.1 + IL_006e: ldloc.0 + IL_006f: blt.un.s IL_004d + + IL_0071: ret + } + + .method public static void f8(native uint step) cil managed + { + + .maxstack 5 + .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 0x0 + IL_000a: conv.u + IL_000b: bne.un.s IL_002b + + IL_000d: ldc.i8 0x1 + IL_0016: conv.u + IL_0017: ldarg.0 + IL_0018: ldc.i8 0xa + IL_0021: conv.u + IL_0022: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0027: pop + IL_0028: nop + IL_0029: br.s IL_002c + + IL_002b: nop + IL_002c: ldc.i8 0xa + IL_0035: conv.u + IL_0036: ldc.i8 0x1 + IL_003f: conv.u + IL_0040: bge.un.s IL_004f + + IL_0042: ldc.i8 0x0 + IL_004b: conv.u + IL_004c: nop + IL_004d: br.s IL_0067 + + IL_004f: ldc.i8 0xa + IL_0058: conv.u + IL_0059: ldc.i8 0x1 + IL_0062: conv.u + IL_0063: sub + IL_0064: ldarg.0 + IL_0065: div.un + IL_0066: nop + IL_0067: stloc.0 + IL_0068: sizeof [runtime]System.IntPtr + IL_006e: ldc.i4.4 + IL_006f: bne.un.s IL_0081 + + IL_0071: ldloc.0 + IL_0072: ldc.i8 0xffffffff + IL_007b: conv.u + IL_007c: ceq + IL_007e: nop + IL_007f: br.s IL_008f + + IL_0081: ldloc.0 + IL_0082: ldc.i8 0xffffffffffffffff + IL_008b: conv.u + IL_008c: ceq + IL_008e: nop + IL_008f: brfalse.s IL_00d4 + + IL_0091: ldc.i4.1 + IL_0092: stloc.1 + IL_0093: ldc.i8 0x0 + IL_009c: conv.u + IL_009d: stloc.2 + IL_009e: ldc.i8 0x1 + IL_00a7: conv.u + IL_00a8: stloc.3 + IL_00a9: br.s IL_00d0 + + IL_00ab: ldloc.3 + IL_00ac: call void assembly::set_c(native uint) + IL_00b1: ldloc.3 + IL_00b2: ldarg.0 + IL_00b3: add + IL_00b4: stloc.3 + IL_00b5: ldloc.2 + IL_00b6: ldc.i8 0x1 + IL_00bf: conv.u + IL_00c0: add + IL_00c1: stloc.2 + IL_00c2: ldloc.2 + IL_00c3: ldc.i8 0x0 + IL_00cc: conv.u + IL_00cd: cgt.un + IL_00cf: stloc.1 + IL_00d0: ldloc.1 + IL_00d1: brtrue.s IL_00ab + + IL_00d3: ret + + IL_00d4: ldc.i8 0xa + IL_00dd: conv.u + IL_00de: ldc.i8 0x1 + IL_00e7: conv.u + IL_00e8: bge.un.s IL_00f7 + + IL_00ea: ldc.i8 0x0 + IL_00f3: conv.u + IL_00f4: nop + IL_00f5: br.s IL_011a + + IL_00f7: ldc.i8 0xa + IL_0100: conv.u + IL_0101: ldc.i8 0x1 + IL_010a: conv.u + IL_010b: sub + IL_010c: ldarg.0 + IL_010d: div.un + IL_010e: ldc.i8 0x1 + IL_0117: conv.u + IL_0118: add.ovf.un + IL_0119: nop + IL_011a: stloc.2 + IL_011b: ldc.i8 0x0 + IL_0124: conv.u + IL_0125: stloc.3 + IL_0126: ldc.i8 0x1 + IL_012f: conv.u + IL_0130: stloc.s V_4 + IL_0132: br.s IL_014e + + IL_0134: ldloc.s V_4 + IL_0136: call void assembly::set_c(native uint) + IL_013b: ldloc.s V_4 + IL_013d: ldarg.0 + IL_013e: add + IL_013f: stloc.s V_4 + IL_0141: ldloc.3 + IL_0142: ldc.i8 0x1 + IL_014b: conv.u + IL_014c: add + IL_014d: stloc.3 + IL_014e: ldloc.3 + IL_014f: ldloc.2 + IL_0150: blt.un.s IL_0134 + + IL_0152: ret + } + + .method public static void f9(native uint finish) cil managed + { + + .maxstack 4 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + 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_003d + + IL_001a: ldarg.0 + IL_001b: ldc.i8 0x1 + IL_0024: conv.u + IL_0025: sub + IL_0026: ldc.i8 0x2 + IL_002f: conv.u + IL_0030: div.un + IL_0031: ldc.i8 0x1 + IL_003a: conv.u + IL_003b: add.ovf.un + IL_003c: nop + IL_003d: stloc.0 + IL_003e: ldc.i8 0x0 + IL_0047: conv.u + IL_0048: stloc.1 + IL_0049: ldc.i8 0x1 + IL_0052: conv.u + IL_0053: stloc.2 + IL_0054: br.s IL_0076 + + IL_0056: ldloc.2 + IL_0057: call void assembly::set_c(native uint) + IL_005c: ldloc.2 + IL_005d: ldc.i8 0x2 + IL_0066: conv.u + IL_0067: add + IL_0068: stloc.2 + IL_0069: ldloc.1 + IL_006a: ldc.i8 0x1 + IL_0073: conv.u + IL_0074: add + IL_0075: stloc.1 + IL_0076: ldloc.1 + IL_0077: ldloc.0 + IL_0078: blt.un.s IL_0056 + + IL_007a: ret + } + + .method public static void f10(native uint start, + native uint step, + native uint finish) cil managed + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationArgumentCountsAttribute::.ctor(int32[]) = ( 01 00 03 00 00 00 01 00 00 00 01 00 00 00 01 00 + 00 00 00 00 ) + + .maxstack 5 + .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: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: bne.un.s IL_0019 + + IL_000d: ldarg.2 + IL_000e: ldarg.1 + IL_000f: ldarg.2 + IL_0010: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0015: pop + IL_0016: nop + IL_0017: br.s IL_001a + + IL_0019: nop + IL_001a: ldarg.2 + IL_001b: ldarg.2 + IL_001c: bge.un.s IL_002b + + IL_001e: ldc.i8 0x0 + IL_0027: conv.u + IL_0028: nop + IL_0029: br.s IL_0031 + + IL_002b: ldarg.2 + IL_002c: ldarg.2 + IL_002d: sub + IL_002e: ldarg.1 + IL_002f: div.un + IL_0030: nop + IL_0031: stloc.0 + IL_0032: sizeof [runtime]System.IntPtr + IL_0038: ldc.i4.4 + IL_0039: bne.un.s IL_004b + + IL_003b: ldloc.0 + IL_003c: ldc.i8 0xffffffff + IL_0045: conv.u + IL_0046: ceq + IL_0048: nop + IL_0049: br.s IL_0059 + + IL_004b: ldloc.0 + IL_004c: ldc.i8 0xffffffffffffffff + IL_0055: conv.u + IL_0056: ceq + IL_0058: nop + IL_0059: brfalse.s IL_0095 + + IL_005b: ldc.i4.1 + IL_005c: stloc.1 + IL_005d: ldc.i8 0x0 + IL_0066: conv.u + IL_0067: stloc.2 + IL_0068: ldarg.2 + IL_0069: stloc.3 + IL_006a: br.s IL_0091 + + IL_006c: ldloc.3 + IL_006d: call void assembly::set_c(native uint) + IL_0072: ldloc.3 + IL_0073: ldarg.1 + IL_0074: add + IL_0075: stloc.3 + IL_0076: ldloc.2 + IL_0077: ldc.i8 0x1 + IL_0080: conv.u + IL_0081: add + IL_0082: stloc.2 + IL_0083: ldloc.2 + IL_0084: ldc.i8 0x0 + IL_008d: conv.u + IL_008e: cgt.un + IL_0090: stloc.1 + IL_0091: ldloc.1 + IL_0092: brtrue.s IL_006c + + IL_0094: ret + + IL_0095: ldarg.2 + IL_0096: ldarg.2 + IL_0097: bge.un.s IL_00a6 + + IL_0099: ldc.i8 0x0 + IL_00a2: conv.u + IL_00a3: nop + IL_00a4: br.s IL_00b7 + + IL_00a6: ldarg.2 + IL_00a7: ldarg.2 + IL_00a8: sub + IL_00a9: ldarg.1 + IL_00aa: div.un + IL_00ab: ldc.i8 0x1 + IL_00b4: conv.u + IL_00b5: add.ovf.un + IL_00b6: nop + IL_00b7: stloc.2 + IL_00b8: ldc.i8 0x0 + IL_00c1: conv.u + IL_00c2: stloc.3 + IL_00c3: ldarg.2 + IL_00c4: stloc.s V_4 + IL_00c6: br.s IL_00e2 + + IL_00c8: ldloc.s V_4 + IL_00ca: call void assembly::set_c(native uint) + IL_00cf: ldloc.s V_4 + IL_00d1: ldarg.1 + IL_00d2: add + IL_00d3: stloc.s V_4 + IL_00d5: ldloc.3 + IL_00d6: ldc.i8 0x1 + IL_00df: conv.u + IL_00e0: add + IL_00e1: stloc.3 + IL_00e2: ldloc.3 + IL_00e3: ldloc.2 + IL_00e4: blt.un.s IL_00c8 + + IL_00e6: ret + } + + .method public static void f11(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 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldarg.0 + IL_0001: ldc.i8 0x0 + IL_000a: conv.u + IL_000b: ldarg.1 + IL_000c: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0011: pop + IL_0012: ldc.i8 0x0 + IL_001b: conv.u + IL_001c: stloc.0 + IL_001d: ldc.i8 0x0 + IL_0026: conv.u + IL_0027: stloc.1 + IL_0028: ldarg.0 + IL_0029: stloc.2 + IL_002a: br.s IL_004c + + IL_002c: ldloc.2 + IL_002d: call void assembly::set_c(native uint) + IL_0032: ldloc.2 + IL_0033: ldc.i8 0x0 + IL_003c: conv.u + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i8 0x1 + IL_0049: conv.u + IL_004a: add + IL_004b: stloc.1 + IL_004c: ldloc.1 + IL_004d: ldloc.0 + IL_004e: blt.un.s IL_002c + + IL_0050: ret + } + + .method public static void f12() cil managed + { + + .maxstack 5 + .locals init (native uint V_0, + native uint V_1, + native uint V_2) + IL_0000: ldc.i8 0x1 + IL_0009: conv.u + IL_000a: ldc.i8 0x0 + IL_0013: conv.u + IL_0014: ldc.i8 0xa + IL_001d: conv.u + IL_001e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeUIntPtr(native uint, + native uint, + native uint) + IL_0023: pop + IL_0024: ldc.i8 0x0 + IL_002d: conv.u + IL_002e: stloc.0 + IL_002f: ldc.i8 0x0 + IL_0038: conv.u + IL_0039: stloc.1 + IL_003a: ldc.i8 0x1 + IL_0043: conv.u + IL_0044: stloc.2 + IL_0045: br.s IL_0067 + + IL_0047: ldloc.2 + IL_0048: call void assembly::set_c(native uint) + IL_004d: ldloc.2 + IL_004e: ldc.i8 0x0 + IL_0057: conv.u + IL_0058: add + IL_0059: stloc.2 + IL_005a: ldloc.1 + IL_005b: ldc.i8 0x1 + IL_0064: conv.u + IL_0065: add + IL_0066: stloc.1 + IL_0067: ldloc.1 + IL_0068: ldloc.0 + IL_0069: blt.un.s IL_0047 + + IL_006b: 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 + } + +} + + + + + + diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForLoop.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForLoop.fs index f98947c030b..40ca24c3a14 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForLoop.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/ForLoop.fs @@ -99,24 +99,28 @@ module ForLoopRealInternalSignatureOn = [] let ``NonTrivialBranchingBindingInEnd03_fs_opt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd03.fs SCFLAGS="--optimize-" # NonTrivialBranchingBindingInEnd03.fs --optimize- [] let ``NonTrivialBranchingBindingInEnd03_fs_nonopt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd04.fs SCFLAGS="--optimize+" # NonTrivialBranchingBindingInEnd04.fs --optimize+ [] let ``NonTrivialBranchingBindingInEnd04_fs_opt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd04.fs SCFLAGS="--optimize-" # NonTrivialBranchingBindingInEnd04.fs --optimize- [] let ``NonTrivialBranchingBindingInEnd04_fs_nonopt`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=NonTrivialBranchingBindingInEnd05.fs SCFLAGS="--optimize+" # NonTrivialBranchingBindingInEnd05.fs --optimize+ @@ -131,3 +135,79 @@ module ForLoopRealInternalSignatureOn = compilation |> verifyCompilation + // SOURCE=ForEachRangeStepSByte.fs SCFLAGS="--optimize+" # ForEachRangeStepSByte.fs --optimize+ + [] + let ``ForEachRangeStepSByte_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepByte.fs SCFLAGS="--optimize+" # ForEachRangeStepByte.fs --optimize+ + [] + let ``ForEachRangeStepByte_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepChar.fs SCFLAGS="--optimize+" # ForEachRangeStepChar.fs --optimize+ + [] + let ``ForEachRangeStepChar_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt16.fs SCFLAGS="--optimize+" # ForEachRangeStepInt16.fs --optimize+ + [] + let ``ForEachRangeStepInt16_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt16.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt16.fs --optimize+ + [] + let ``ForEachRangeStepUInt16_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt32.fs SCFLAGS="--optimize+" # ForEachRangeStepInt32.fs --optimize+ + [] + let ``ForEachRangeStepInt32_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt32.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt32.fs --optimize+ + [] + let ``ForEachRangeStepUInt32_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepInt64.fs SCFLAGS="--optimize+" # ForEachRangeStepInt64.fs --optimize+ + [] + let ``ForEachRangeStepInt64_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUInt64.fs SCFLAGS="--optimize+" # ForEachRangeStepUInt64.fs --optimize+ + [] + let ``ForEachRangeStepUInt64_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepIntPtr.fs SCFLAGS="--optimize+" # ForEachRangeStepIntPtr.fs --optimize+ + [] + let ``ForEachRangeStepIntPtr_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation + + // SOURCE=ForEachRangeStepUIntPtr.fs SCFLAGS="--optimize+" # ForEachRangeStepUIntPtr.fs --optimize+ + [] + let ``ForEachRangeStepUIntPtr_fs_opt`` compilation = + compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. + |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.il.bsl index 475e4e35c66..5cab501f026 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.il.bsl @@ -136,7 +136,11 @@ { .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -147,77 +151,115 @@ IL_000e: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, !!0) IL_0013: stsfld int32[] assembly::w@7 - IL_0018: ldc.i4.0 - IL_0019: ldc.i4.1 - IL_001a: call int32[] assembly::get_r() - IL_001f: ldlen - IL_0020: conv.i4 - IL_0021: stsfld int32 assembly::e1@1 - IL_0026: call int32[] assembly::get_w() - IL_002b: ldlen - IL_002c: conv.i4 - IL_002d: stsfld int32 assembly::e2@1 - IL_0032: call int32 assembly::get_e1@1() - IL_0037: call int32 assembly::get_e2@1() - IL_003c: bge.s IL_0046 - - IL_003e: call int32 assembly::get_e1@1() - IL_0043: nop - IL_0044: br.s IL_004c - - IL_0046: call int32 assembly::get_e2@1() - IL_004b: nop - IL_004c: ldc.i4.1 - IL_004d: sub - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_0018: call int32[] assembly::get_r() + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: stsfld int32 assembly::e1@1 + IL_0024: call int32[] assembly::get_w() + IL_0029: ldlen + IL_002a: conv.i4 + IL_002b: stsfld int32 assembly::e2@1 + IL_0030: call int32 assembly::get_e1@1() + IL_0035: call int32 assembly::get_e2@1() + IL_003a: bge.s IL_0044 + + IL_003c: call int32 assembly::get_e1@1() + IL_0041: nop + IL_0042: br.s IL_004a + + IL_0044: call int32 assembly::get_e2@1() + IL_0049: nop + IL_004a: ldc.i4.1 + IL_004b: sub + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005e + + IL_0056: ldloc.0 + IL_0057: ldc.i4.0 + IL_0058: sub + IL_0059: conv.i8 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldc.i4.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop + IL_00eb: nop + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } .property int32[] r() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl index 475e4e35c66..5cab501f026 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd03.fs.opt.il.bsl @@ -136,7 +136,11 @@ { .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -147,77 +151,115 @@ IL_000e: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, !!0) IL_0013: stsfld int32[] assembly::w@7 - IL_0018: ldc.i4.0 - IL_0019: ldc.i4.1 - IL_001a: call int32[] assembly::get_r() - IL_001f: ldlen - IL_0020: conv.i4 - IL_0021: stsfld int32 assembly::e1@1 - IL_0026: call int32[] assembly::get_w() - IL_002b: ldlen - IL_002c: conv.i4 - IL_002d: stsfld int32 assembly::e2@1 - IL_0032: call int32 assembly::get_e1@1() - IL_0037: call int32 assembly::get_e2@1() - IL_003c: bge.s IL_0046 - - IL_003e: call int32 assembly::get_e1@1() - IL_0043: nop - IL_0044: br.s IL_004c - - IL_0046: call int32 assembly::get_e2@1() - IL_004b: nop - IL_004c: ldc.i4.1 - IL_004d: sub - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_0018: call int32[] assembly::get_r() + IL_001d: ldlen + IL_001e: conv.i4 + IL_001f: stsfld int32 assembly::e1@1 + IL_0024: call int32[] assembly::get_w() + IL_0029: ldlen + IL_002a: conv.i4 + IL_002b: stsfld int32 assembly::e2@1 + IL_0030: call int32 assembly::get_e1@1() + IL_0035: call int32 assembly::get_e2@1() + IL_003a: bge.s IL_0044 + + IL_003c: call int32 assembly::get_e1@1() + IL_0041: nop + IL_0042: br.s IL_004a + + IL_0044: call int32 assembly::get_e2@1() + IL_0049: nop + IL_004a: ldc.i4.1 + IL_004b: sub + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005e + + IL_0056: ldloc.0 + IL_0057: ldc.i4.0 + IL_0058: sub + IL_0059: conv.i8 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldc.i4.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop + IL_00eb: nop + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } .property int32[] r() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.il.bsl index 07b8377812d..fd4946b43f2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.il.bsl @@ -136,7 +136,11 @@ { .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -167,57 +171,95 @@ IL_0049: nop IL_004a: ldc.i4.1 IL_004b: sub - IL_004c: ldc.i4.m1 - IL_004d: ldc.i4.0 - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005e + + IL_0056: ldloc.0 + IL_0057: ldc.i4.0 + IL_0058: sub + IL_0059: conv.i8 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldloc.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.m1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop + IL_00eb: nop + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } .property int32[] r() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl index 07b8377812d..fd4946b43f2 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ForLoop/RealInternalSignatureOn/NonTrivialBranchingBindingInEnd04.fs.opt.il.bsl @@ -136,7 +136,11 @@ { .maxstack 7 - .locals init (int32 V_0) + .locals init (int32 V_0, + uint64 V_1, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_2, + uint64 V_3, + int32 V_4) IL_0000: ldc.i4.8 IL_0001: ldc.i4.1 IL_0002: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Create(int32, @@ -167,57 +171,95 @@ IL_0049: nop IL_004a: ldc.i4.1 IL_004b: sub - IL_004c: ldc.i4.m1 - IL_004d: ldc.i4.0 - IL_004e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0053: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0058: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_005d: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 - IL_0062: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0067: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_006c: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 - IL_0071: br.s IL_00b9 - - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_0078: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_007d: stloc.0 - IL_007e: call int32[] assembly::get_r() - IL_0083: ldloc.0 - IL_0084: call int32[] assembly::get_r() - IL_0089: ldloc.0 - IL_008a: ldelem [runtime]System.Int32 - IL_008f: call int32[] assembly::get_w() - IL_0094: ldloc.0 - IL_0095: ldelem [runtime]System.Int32 - IL_009a: add - IL_009b: stelem [runtime]System.Int32 - IL_00a0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00a5: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00aa: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() - IL_00af: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_00b4: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b9: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() - IL_00be: brtrue.s IL_0073 - - IL_00c0: nop - IL_00c1: nop - IL_00c2: call int32[] assembly::get_r() - IL_00c7: ldc.i4.0 - IL_00c8: ldelem [runtime]System.Int32 - IL_00cd: ldc.i4.3 - IL_00ce: bne.un.s IL_00d4 - - IL_00d0: ldc.i4.0 - IL_00d1: nop - IL_00d2: br.s IL_00d6 - - IL_00d4: ldc.i4.1 - IL_00d5: nop - IL_00d6: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) - IL_00db: pop - IL_00dc: ret + IL_004c: stloc.0 + IL_004d: ldloc.0 + IL_004e: ldc.i4.0 + IL_004f: bge.s IL_0056 + + IL_0051: ldc.i4.0 + IL_0052: conv.i8 + IL_0053: nop + IL_0054: br.s IL_005e + + IL_0056: ldloc.0 + IL_0057: ldc.i4.0 + IL_0058: sub + IL_0059: conv.i8 + IL_005a: ldc.i4.1 + IL_005b: conv.i8 + IL_005c: add + IL_005d: nop + IL_005e: stloc.1 + IL_005f: ldc.i4.0 + IL_0060: conv.i8 + IL_0061: stloc.3 + IL_0062: ldloc.0 + IL_0063: stloc.s V_4 + IL_0065: br.s IL_007c + + IL_0067: ldloca.s V_2 + IL_0069: ldloc.s V_4 + IL_006b: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0070: nop + IL_0071: ldloc.s V_4 + IL_0073: ldc.i4.m1 + IL_0074: add + IL_0075: stloc.s V_4 + IL_0077: ldloc.3 + IL_0078: ldc.i4.1 + IL_0079: conv.i8 + IL_007a: add + IL_007b: stloc.3 + IL_007c: ldloc.3 + IL_007d: ldloc.1 + IL_007e: blt.un.s IL_0067 + + IL_0080: ldloca.s V_2 + IL_0082: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0087: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::current@9 + IL_008c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_0091: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0096: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::next@9 + IL_009b: br.s IL_00e3 + + IL_009d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00a2: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_00a7: stloc.0 + IL_00a8: call int32[] assembly::get_r() + IL_00ad: ldloc.0 + IL_00ae: call int32[] assembly::get_r() + IL_00b3: ldloc.0 + IL_00b4: ldelem [runtime]System.Int32 + IL_00b9: call int32[] assembly::get_w() + IL_00be: ldloc.0 + IL_00bf: ldelem [runtime]System.Int32 + IL_00c4: add + IL_00c5: stelem [runtime]System.Int32 + IL_00ca: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00cf: call void assembly::set_current@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00d4: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_current@9() + IL_00d9: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_00de: call void assembly::set_next@9(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00e3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_next@9() + IL_00e8: brtrue.s IL_009d + + IL_00ea: nop + IL_00eb: nop + IL_00ec: call int32[] assembly::get_r() + IL_00f1: ldc.i4.0 + IL_00f2: ldelem [runtime]System.Int32 + IL_00f7: ldc.i4.3 + IL_00f8: bne.un.s IL_00fe + + IL_00fa: ldc.i4.0 + IL_00fb: nop + IL_00fc: br.s IL_0100 + + IL_00fe: ldc.i4.1 + IL_00ff: nop + IL_0100: call !!0 [FSharp.Core]Microsoft.FSharp.Core.Operators::Exit(int32) + IL_0105: pop + IL_0106: ret } .property int32[] r() diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl index 7c3b365ff57..5ad3388f883 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare08.fsx.il.bsl @@ -54,46 +54,85 @@ .locals init (int32 V_0, uint8[] V_1, uint8[] V_2, - int32 V_3) + uint16 V_3, + uint8 V_4, + uint8[] V_5, + int32 V_6) IL_0000: ldc.i4.1 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: newarr [runtime]System.Byte + IL_0009: stloc.2 + IL_000a: ldc.i4.0 + IL_000b: stloc.3 + IL_000c: ldc.i4.0 + IL_000d: stloc.s V_4 + IL_000f: br.s IL_0020 + + IL_0011: ldloc.2 + IL_0012: ldloc.3 + IL_0013: ldloc.s V_4 + IL_0015: stelem.i1 + IL_0016: ldloc.s V_4 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.s V_4 + IL_001c: ldloc.3 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.3 + IL_0020: ldloc.3 + IL_0021: ldc.i4.s 101 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.2 + IL_0026: stloc.1 + IL_0027: ldc.i4.s 101 + IL_0029: newarr [runtime]System.Byte + IL_002e: stloc.s V_5 + IL_0030: ldc.i4.0 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0047 + + IL_0037: ldloc.s V_5 + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: stelem.i1 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.3 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldc.i4.s 101 + IL_004a: blt.un.s IL_0037 + + IL_004c: ldloc.s V_5 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.s V_6 + IL_0052: br.s IL_0062 + + IL_0054: ldloc.1 + IL_0055: ldloc.2 + IL_0056: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x989681 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_005b: stloc.0 + IL_005c: ldloc.s V_6 + IL_005e: ldc.i4.1 + IL_005f: add + IL_0060: stloc.s V_6 + IL_0062: ldloc.s V_6 + IL_0064: ldc.i4 0x989681 + IL_0069: blt.s IL_0054 + + IL_006b: ldloc.0 + IL_006c: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl index b734a546b40..261d118d9a9 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Compare09.fsx.il.bsl @@ -54,46 +54,96 @@ .locals init (int32 V_0, int32[] V_1, int32[] V_2, - int32 V_3) + uint64 V_3, + int32 V_4, + int32[] V_5) IL_0000: ldc.i4.1 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: conv.i8 + IL_0005: conv.ovf.i.un + IL_0006: newarr [runtime]System.Int32 + IL_000b: stloc.2 + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: stloc.3 + IL_000f: ldc.i4.0 + IL_0010: stloc.s V_4 + IL_0012: br.s IL_0025 + + IL_0014: ldloc.2 + IL_0015: ldloc.3 + IL_0016: conv.i + IL_0017: ldloc.s V_4 + IL_0019: stelem.i4 + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.3 + IL_0025: ldloc.3 + IL_0026: ldc.i4.s 101 + IL_0028: conv.i8 + IL_0029: blt.un.s IL_0014 + + IL_002b: ldloc.2 + IL_002c: stloc.1 + IL_002d: ldc.i4.s 101 + IL_002f: conv.i8 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.s V_5 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.3 + IL_003b: ldc.i4.0 + IL_003c: stloc.s V_4 + IL_003e: br.s IL_0052 + + IL_0040: ldloc.s V_5 + IL_0042: ldloc.3 + IL_0043: conv.i + IL_0044: ldloc.s V_4 + IL_0046: stelem.i4 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldc.i4.s 101 + IL_0055: conv.i8 + IL_0056: blt.un.s IL_0040 + + IL_0058: ldloc.s V_5 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: stloc.s V_4 + IL_005e: br.s IL_006e + + IL_0060: ldloc.1 + IL_0061: ldloc.2 + IL_0062: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericComparisonIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x186a1 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_0067: stloc.0 + IL_0068: ldloc.s V_4 + IL_006a: ldc.i4.1 + IL_006b: add + IL_006c: stloc.s V_4 + IL_006e: ldloc.s V_4 + IL_0070: ldc.i4 0x186a1 + IL_0075: blt.s IL_0060 + + IL_0077: ldloc.0 + IL_0078: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl index a175818aeb3..9e7afe0aa8c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals07.fsx.il.bsl @@ -54,46 +54,85 @@ .locals init (bool V_0, uint8[] V_1, uint8[] V_2, - int32 V_3) + uint16 V_3, + uint8 V_4, + uint8[] V_5, + int32 V_6) IL_0000: ldc.i4.0 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: newarr [runtime]System.Byte + IL_0009: stloc.2 + IL_000a: ldc.i4.0 + IL_000b: stloc.3 + IL_000c: ldc.i4.0 + IL_000d: stloc.s V_4 + IL_000f: br.s IL_0020 + + IL_0011: ldloc.2 + IL_0012: ldloc.3 + IL_0013: ldloc.s V_4 + IL_0015: stelem.i1 + IL_0016: ldloc.s V_4 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.s V_4 + IL_001c: ldloc.3 + IL_001d: ldc.i4.1 + IL_001e: add + IL_001f: stloc.3 + IL_0020: ldloc.3 + IL_0021: ldc.i4.s 101 + IL_0023: blt.un.s IL_0011 + + IL_0025: ldloc.2 + IL_0026: stloc.1 + IL_0027: ldc.i4.s 101 + IL_0029: newarr [runtime]System.Byte + IL_002e: stloc.s V_5 + IL_0030: ldc.i4.0 + IL_0031: stloc.3 + IL_0032: ldc.i4.0 + IL_0033: stloc.s V_4 + IL_0035: br.s IL_0047 + + IL_0037: ldloc.s V_5 + IL_0039: ldloc.3 + IL_003a: ldloc.s V_4 + IL_003c: stelem.i1 + IL_003d: ldloc.s V_4 + IL_003f: ldc.i4.1 + IL_0040: add + IL_0041: stloc.s V_4 + IL_0043: ldloc.3 + IL_0044: ldc.i4.1 + IL_0045: add + IL_0046: stloc.3 + IL_0047: ldloc.3 + IL_0048: ldc.i4.s 101 + IL_004a: blt.un.s IL_0037 + + IL_004c: ldloc.s V_5 + IL_004e: stloc.2 + IL_004f: ldc.i4.0 + IL_0050: stloc.s V_6 + IL_0052: br.s IL_0062 + + IL_0054: ldloc.1 + IL_0055: ldloc.2 + IL_0056: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x989681 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_005b: stloc.0 + IL_005c: ldloc.s V_6 + IL_005e: ldc.i4.1 + IL_005f: add + IL_0060: stloc.s V_6 + IL_0062: ldloc.s V_6 + IL_0064: ldc.i4 0x989681 + IL_0069: blt.s IL_0054 + + IL_006b: ldloc.0 + IL_006c: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl index 6125092813b..02acab4575c 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Equals08.fsx.il.bsl @@ -54,46 +54,96 @@ .locals init (bool V_0, int32[] V_1, int32[] V_2, - int32 V_3) + uint64 V_3, + int32 V_4, + int32[] V_5) IL_0000: ldc.i4.0 IL_0001: stloc.0 - IL_0002: ldc.i4.0 - IL_0003: ldc.i4.1 - IL_0004: ldc.i4.s 100 - IL_0006: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0010: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0015: stloc.1 - IL_0016: ldc.i4.0 - IL_0017: ldc.i4.1 - IL_0018: ldc.i4.s 100 - IL_001a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_001f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0024: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0029: stloc.2 - IL_002a: ldc.i4.0 - IL_002b: stloc.3 - IL_002c: br.s IL_003a - - IL_002e: ldloc.1 - IL_002f: ldloc.2 - IL_0030: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, + IL_0002: ldc.i4.s 101 + IL_0004: conv.i8 + IL_0005: conv.ovf.i.un + IL_0006: newarr [runtime]System.Int32 + IL_000b: stloc.2 + IL_000c: ldc.i4.0 + IL_000d: conv.i8 + IL_000e: stloc.3 + IL_000f: ldc.i4.0 + IL_0010: stloc.s V_4 + IL_0012: br.s IL_0025 + + IL_0014: ldloc.2 + IL_0015: ldloc.3 + IL_0016: conv.i + IL_0017: ldloc.s V_4 + IL_0019: stelem.i4 + IL_001a: ldloc.s V_4 + IL_001c: ldc.i4.1 + IL_001d: add + IL_001e: stloc.s V_4 + IL_0020: ldloc.3 + IL_0021: ldc.i4.1 + IL_0022: conv.i8 + IL_0023: add + IL_0024: stloc.3 + IL_0025: ldloc.3 + IL_0026: ldc.i4.s 101 + IL_0028: conv.i8 + IL_0029: blt.un.s IL_0014 + + IL_002b: ldloc.2 + IL_002c: stloc.1 + IL_002d: ldc.i4.s 101 + IL_002f: conv.i8 + IL_0030: conv.ovf.i.un + IL_0031: newarr [runtime]System.Int32 + IL_0036: stloc.s V_5 + IL_0038: ldc.i4.0 + IL_0039: conv.i8 + IL_003a: stloc.3 + IL_003b: ldc.i4.0 + IL_003c: stloc.s V_4 + IL_003e: br.s IL_0052 + + IL_0040: ldloc.s V_5 + IL_0042: ldloc.3 + IL_0043: conv.i + IL_0044: ldloc.s V_4 + IL_0046: stelem.i4 + IL_0047: ldloc.s V_4 + IL_0049: ldc.i4.1 + IL_004a: add + IL_004b: stloc.s V_4 + IL_004d: ldloc.3 + IL_004e: ldc.i4.1 + IL_004f: conv.i8 + IL_0050: add + IL_0051: stloc.3 + IL_0052: ldloc.3 + IL_0053: ldc.i4.s 101 + IL_0055: conv.i8 + IL_0056: blt.un.s IL_0040 + + IL_0058: ldloc.s V_5 + IL_005a: stloc.2 + IL_005b: ldc.i4.0 + IL_005c: stloc.s V_4 + IL_005e: br.s IL_006e + + IL_0060: ldloc.1 + IL_0061: ldloc.2 + IL_0062: call bool [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericEqualityIntrinsic(!!0, !!0) - IL_0035: stloc.0 - IL_0036: ldloc.3 - IL_0037: ldc.i4.1 - IL_0038: add - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: ldc.i4 0x989681 - IL_0040: blt.s IL_002e - - IL_0042: ldloc.0 - IL_0043: ret + IL_0067: stloc.0 + IL_0068: ldloc.s V_4 + IL_006a: ldc.i4.1 + IL_006b: add + IL_006c: stloc.s V_4 + IL_006e: ldloc.s V_4 + IL_0070: ldc.i4 0x989681 + IL_0075: blt.s IL_0060 + + IL_0077: ldloc.0 + IL_0078: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs index b421ca1bf11..57d287f2c42 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/GenericComparison.fs @@ -62,12 +62,14 @@ module GenericComparison = [] let ``Compare08_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Compare09.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Compare09.dll" # Compare09.fs [] let ``Compare09_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Compare10.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Compare10.dll" # Compare10.fs - @@ -142,12 +144,14 @@ module GenericComparison = [] let ``Hash10_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Hash11.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Hash11.dll" # Hash11.fs [] let ``Hash11_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Hash12.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Hash12.dll" # Hash12.fs - @@ -197,12 +201,14 @@ module GenericComparison = [] let ``Equals07_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Equals08.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Equals08.dll" # Equals08.fs - [] let ``Equals08_fsx`` compilation = compilation + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=Equals09.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Equals09.dll" # Equals09.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl index 3c5b5009606..0ad4e24c843 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash10.fsx.il.bsl @@ -52,34 +52,55 @@ .maxstack 5 .locals init (uint8[] V_0, - int32 V_1, - int32 V_2) + uint8[] V_1, + uint16 V_2, + uint8 V_3, + int32 V_4, + int32 V_5) IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 100 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeByte(uint8, - uint8, - uint8) - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000f: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: br.s IL_0024 - - IL_0019: ldloc.0 - IL_001a: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) - IL_001f: stloc.2 + IL_0001: ldc.i4.s 101 + IL_0003: newarr [runtime]System.Byte + IL_0008: stloc.1 + IL_0009: ldc.i4.0 + IL_000a: stloc.2 + IL_000b: ldc.i4.0 + IL_000c: stloc.3 + IL_000d: br.s IL_001b + + IL_000f: ldloc.1 + IL_0010: ldloc.2 + IL_0011: ldloc.3 + IL_0012: stelem.i1 + IL_0013: ldloc.3 + IL_0014: ldc.i4.1 + IL_0015: add + IL_0016: stloc.3 + IL_0017: ldloc.2 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.2 + IL_001b: ldloc.2 + IL_001c: ldc.i4.s 101 + IL_001e: blt.un.s IL_000f + IL_0020: ldloc.1 - IL_0021: ldc.i4.1 - IL_0022: add - IL_0023: stloc.1 - IL_0024: ldloc.1 - IL_0025: ldc.i4 0x989681 - IL_002a: blt.s IL_0019 - - IL_002c: ret + IL_0021: stloc.0 + IL_0022: ldc.i4.0 + IL_0023: stloc.s V_4 + IL_0025: br.s IL_0035 + + IL_0027: ldloc.0 + IL_0028: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_002d: stloc.s V_5 + IL_002f: ldloc.s V_4 + IL_0031: ldc.i4.1 + IL_0032: add + IL_0033: stloc.s V_4 + IL_0035: ldloc.s V_4 + IL_0037: ldc.i4 0x989681 + IL_003c: blt.s IL_0027 + + IL_003e: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl index ba62710f013..5e8ba8dc8f5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/GenericComparison/Hash11.fsx.il.bsl @@ -52,34 +52,60 @@ .maxstack 5 .locals init (int32[] V_0, - int32 V_1, - int32 V_2) + int32[] V_1, + uint64 V_2, + int32 V_3, + int32 V_4) IL_0000: nop - IL_0001: ldc.i4.0 - IL_0002: ldc.i4.1 - IL_0003: ldc.i4.s 100 - IL_0005: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_000a: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000f: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToArray(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0014: stloc.0 - IL_0015: ldc.i4.0 - IL_0016: stloc.1 - IL_0017: br.s IL_0024 - - IL_0019: ldloc.0 - IL_001a: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_0001: ldc.i4.s 101 + IL_0003: conv.i8 + IL_0004: conv.ovf.i.un + IL_0005: newarr [runtime]System.Int32 + IL_000a: stloc.1 + IL_000b: ldc.i4.0 + IL_000c: conv.i8 + IL_000d: stloc.2 + IL_000e: ldc.i4.0 + IL_000f: stloc.3 + IL_0010: br.s IL_0020 + + IL_0012: ldloc.1 + IL_0013: ldloc.2 + IL_0014: conv.i + IL_0015: ldloc.3 + IL_0016: stelem.i4 + IL_0017: ldloc.3 + IL_0018: ldc.i4.1 + IL_0019: add + IL_001a: stloc.3 + IL_001b: ldloc.2 + IL_001c: ldc.i4.1 + IL_001d: conv.i8 + 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: ldc.i4 0x989681 - IL_002a: blt.s IL_0019 - - IL_002c: ret + IL_0020: ldloc.2 + IL_0021: ldc.i4.s 101 + IL_0023: conv.i8 + IL_0024: blt.un.s IL_0012 + + IL_0026: ldloc.1 + IL_0027: stloc.0 + IL_0028: ldc.i4.0 + IL_0029: stloc.3 + IL_002a: br.s IL_0038 + + IL_002c: ldloc.0 + IL_002d: call int32 [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/HashCompare::GenericHashIntrinsic(!!0) + IL_0032: stloc.s V_4 + IL_0034: ldloc.3 + IL_0035: ldc.i4.1 + IL_0036: add + IL_0037: stloc.3 + IL_0038: ldloc.3 + IL_0039: ldc.i4 0x989681 + IL_003e: blt.s IL_002c + + IL_0040: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs index abdc6368d11..78c95d80d00 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping.fs @@ -35,6 +35,7 @@ module ListExpressionStepping = let ``ListExpressionStepping02_RealInternalSignatureOn_fs`` compilation = compilation |> withRealInternalSignatureOn + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=ListExpressionSteppingTest2.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ListExpressionSteppingTest2.exe" # ListExpressionSteppingTest2.fs - diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOff.il.bsl index a8e6ce9949c..4fdb1c34a07 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOff.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOff.il.bsl @@ -51,8 +51,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`2> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .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 ) @@ -63,8 +62,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`2 - Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`2 Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed { .maxstack 7 @@ -85,8 +83,7 @@ IL_0017: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -101,8 +98,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`2> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .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 ) @@ -113,8 +109,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`2 - Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`2 Invoke(class [runtime]System.Tuple`2 tupledArg) cil managed { .maxstack 7 @@ -135,8 +130,7 @@ IL_0017: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -151,8 +145,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`3> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .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 ) @@ -163,8 +156,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`3 - Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`3 Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed { .maxstack 7 @@ -191,8 +183,7 @@ IL_001f: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -207,8 +198,7 @@ extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2,class [runtime]System.Tuple`3> { .field static assembly initonly class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 @_instance - .method assembly specialname rtspecialname - instance void .ctor() cil managed + .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 ) @@ -219,8 +209,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Tuple`3 - Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed + .method public strict virtual instance class [runtime]System.Tuple`3 Invoke(class [runtime]System.Tuple`3 tupledArg) cil managed { .maxstack 7 @@ -247,8 +236,7 @@ IL_001f: ret } - .method private specialname rtspecialname static - void .cctor() cil managed + .method private specialname rtspecialname static void .cctor() cil managed { .maxstack 10 @@ -259,8 +247,7 @@ } - .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - f1() cil managed + .method public static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 f1() cil managed { .maxstack 4 @@ -287,8 +274,7 @@ IL_003a: ret } - .method public static class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> - f2(!!a x) cil managed + .method public static class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>> f2(!!a x) cil managed { .maxstack 6 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOn.il.bsl index a36fbb087b0..5e88a197fcd 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/ListExpressionStepping/ListExpressionStepping02.fs.RealInternalSignatureOn.il.bsl @@ -79,7 +79,7 @@ IL_0010: ldc.i4.1 IL_0011: add IL_0012: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) + !1) IL_0017: ret } @@ -126,7 +126,7 @@ IL_0010: ldc.i4.1 IL_0011: add IL_0012: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) + !1) IL_0017: ret } @@ -178,8 +178,8 @@ IL_0018: add IL_0019: ldloc.2 IL_001a: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, - !1, - !2) + !1, + !2) IL_001f: ret } @@ -231,8 +231,8 @@ IL_0018: add IL_0019: ldloc.2 IL_001a: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, - !1, - !2) + !1, + !2) IL_001f: ret } @@ -281,14 +281,23 @@ .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_3, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_4, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_5, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_6, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_7, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_8, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_9, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_10) + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_3, + uint64 V_4, + int32 V_5, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_6, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_7, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_8, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_9, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_10, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_11, + uint64 V_12, + int32 V_13, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_14, + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_15, + uint64 V_16, + int32 V_17, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_18, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> V_19) IL_0000: ldarg.0 IL_0001: ldarg.0 IL_0002: ldarg.0 @@ -301,80 +310,137 @@ class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) IL_0017: stloc.1 IL_0018: ldc.i4.0 - IL_0019: ldc.i4.1 - IL_001a: ldc.i4.2 - IL_001b: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0020: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0025: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_002a: stloc.2 - IL_002b: ldloc.1 - IL_002c: ldloc.2 - IL_002d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0032: stloc.3 - IL_0033: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance - IL_0038: ldloc.3 - IL_0039: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_003e: stloc.s V_4 - IL_0040: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance - IL_0045: ldloc.s V_4 - IL_0047: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_004c: stloc.0 - IL_004d: ldarg.0 - IL_004e: ldarg.0 - IL_004f: ldarg.0 - IL_0050: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() - IL_0055: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0019: conv.i8 + IL_001a: stloc.s V_4 + IL_001c: ldc.i4.0 + IL_001d: stloc.s V_5 + IL_001f: br.s IL_0038 + + IL_0021: ldloca.s V_3 + IL_0023: ldloc.s V_5 + IL_0025: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_002a: nop + IL_002b: ldloc.s V_5 + IL_002d: ldc.i4.1 + IL_002e: add + IL_002f: stloc.s V_5 + IL_0031: ldloc.s V_4 + IL_0033: ldc.i4.1 + IL_0034: conv.i8 + IL_0035: add + IL_0036: stloc.s V_4 + IL_0038: ldloc.s V_4 + IL_003a: ldc.i4.3 + IL_003b: conv.i8 + IL_003c: blt.un.s IL_0021 + + IL_003e: ldloca.s V_3 + IL_0040: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0045: stloc.2 + IL_0046: ldloc.1 + IL_0047: ldloc.2 + IL_0048: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_004d: stloc.s V_6 + IL_004f: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #1 stage #2 at line 18@18'::@_instance + IL_0054: ldloc.s V_6 + IL_0056: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_005b: stloc.s V_7 + IL_005d: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs1@19::@_instance + IL_0062: ldloc.s V_7 + IL_0064: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`2>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0069: stloc.0 + IL_006a: ldarg.0 + IL_006b: ldarg.0 + IL_006c: ldarg.0 + IL_006d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_Empty() + IL_0072: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005a: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_0077: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_005f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, + IL_007c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::Cons(!0, class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0064: stloc.s V_6 - IL_0066: ldc.i4.0 - IL_0067: ldc.i4.1 - IL_0068: ldc.i4.2 - IL_0069: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_006e: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0073: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0078: stloc.s V_7 - IL_007a: ldc.i4.0 - IL_007b: ldc.i4.1 - IL_007c: ldc.i4.2 - IL_007d: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0082: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0087: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_008c: stloc.s V_8 - IL_008e: ldloc.s V_6 - IL_0090: ldloc.s V_7 - IL_0092: ldloc.s V_8 - IL_0094: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0099: stloc.s V_9 - IL_009b: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance - IL_00a0: ldloc.s V_9 - IL_00a2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00a7: stloc.s V_10 - IL_00a9: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance - IL_00ae: ldloc.s V_10 - IL_00b0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_00b5: stloc.s V_5 - IL_00b7: ldloc.0 - IL_00b8: ldloc.s V_5 - IL_00ba: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, - !1) - IL_00bf: ret + IL_0081: stloc.s V_9 + IL_0083: ldc.i4.0 + IL_0084: conv.i8 + IL_0085: stloc.s V_12 + IL_0087: ldc.i4.0 + IL_0088: stloc.s V_13 + IL_008a: br.s IL_00a3 + + IL_008c: ldloca.s V_11 + IL_008e: ldloc.s V_13 + IL_0090: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_0095: nop + IL_0096: ldloc.s V_13 + IL_0098: ldc.i4.1 + IL_0099: add + IL_009a: stloc.s V_13 + IL_009c: ldloc.s V_12 + IL_009e: ldc.i4.1 + IL_009f: conv.i8 + IL_00a0: add + IL_00a1: stloc.s V_12 + IL_00a3: ldloc.s V_12 + IL_00a5: ldc.i4.3 + IL_00a6: conv.i8 + IL_00a7: blt.un.s IL_008c + + IL_00a9: ldloca.s V_11 + IL_00ab: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00b0: stloc.s V_10 + IL_00b2: ldc.i4.0 + IL_00b3: conv.i8 + IL_00b4: stloc.s V_16 + IL_00b6: ldc.i4.0 + IL_00b7: stloc.s V_17 + IL_00b9: br.s IL_00d2 + + IL_00bb: ldloca.s V_15 + IL_00bd: ldloc.s V_17 + IL_00bf: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_00c4: nop + IL_00c5: ldloc.s V_17 + IL_00c7: ldc.i4.1 + IL_00c8: add + IL_00c9: stloc.s V_17 + IL_00cb: ldloc.s V_16 + IL_00cd: ldc.i4.1 + IL_00ce: conv.i8 + IL_00cf: add + IL_00d0: stloc.s V_16 + IL_00d2: ldloc.s V_16 + IL_00d4: ldc.i4.3 + IL_00d5: conv.i8 + IL_00d6: blt.un.s IL_00bb + + IL_00d8: ldloca.s V_15 + IL_00da: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_00df: stloc.s V_14 + IL_00e1: ldloc.s V_9 + IL_00e3: ldloc.s V_10 + IL_00e5: ldloc.s V_14 + IL_00e7: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Zip3(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00ec: stloc.s V_18 + IL_00ee: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24' class ListExpressionSteppingTest2/ListExpressionSteppingTest2/'Pipe #2 stage #2 at line 24@24'::@_instance + IL_00f3: ldloc.s V_18 + IL_00f5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_00fa: stloc.s V_19 + IL_00fc: ldsfld class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25 class ListExpressionSteppingTest2/ListExpressionSteppingTest2/xs2@25::@_instance + IL_0101: ldloc.s V_19 + IL_0103: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::Map,class [runtime]System.Tuple`3>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0108: stloc.s V_8 + IL_010a: ldloc.0 + IL_010b: ldloc.s V_8 + IL_010d: newobj instance void class [runtime]System.Tuple`2>,class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>>::.ctor(!0, + !1) + IL_0112: ret } .method private specialname rtspecialname static void .cctor() cil managed diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOff.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOff.il.bsl index 2e77dc87b3d..045bd18ffe7 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOff.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOff.il.bsl @@ -72,8 +72,7 @@ IL_0014: ret } - .method public strict virtual instance int32 - GenerateNext(class [runtime]System.Collections.Generic.IEnumerable`1>& next) cil managed + .method public strict virtual instance int32 GenerateNext(class [runtime]System.Collections.Generic.IEnumerable`1>& next) cil managed { .maxstack 7 @@ -131,8 +130,7 @@ IL_0060: ret } - .method public strict virtual instance void - Close() cil managed + .method public strict virtual instance void Close() cil managed { .maxstack 8 @@ -142,8 +140,7 @@ IL_0007: ret } - .method public strict virtual instance bool - get_CheckClose() cil managed + .method public strict virtual instance bool get_CheckClose() cil managed { .maxstack 8 @@ -179,8 +176,7 @@ IL_002f: ret } - .method public strict virtual instance class [runtime]System.Tuple`2 - get_LastGenerated() cil managed + .method public strict virtual instance class [runtime]System.Tuple`2 get_LastGenerated() 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 ) @@ -191,8 +187,7 @@ IL_0006: ret } - .method public strict virtual instance class [runtime]System.Collections.Generic.IEnumerator`1> - GetFreshEnumerator() cil managed + .method public strict virtual instance class [runtime]System.Collections.Generic.IEnumerator`1> GetFreshEnumerator() 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 ) @@ -207,8 +202,7 @@ } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 - get_alist() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 get_alist() cil managed { .maxstack 8 @@ -216,8 +210,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_array() cil managed + .method public specialname static int32[] get_array() cil managed { .maxstack 8 @@ -225,8 +218,7 @@ IL_0005: ret } - .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1 - get_aseq() cil managed + .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1 get_aseq() cil managed { .maxstack 8 @@ -234,8 +226,7 @@ IL_0005: ret } - .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> - get_list1() cil managed + .method public specialname static class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> get_list1() cil managed { .maxstack 8 @@ -243,8 +234,7 @@ IL_0005: ret } - .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1> - get_seq1() cil managed + .method public specialname static class [runtime]System.Collections.Generic.IEnumerable`1> get_seq1() cil managed { .maxstack 8 @@ -252,8 +242,7 @@ IL_0005: ret } - .method public specialname static class [runtime]System.Tuple`2[] - get_array1() cil managed + .method public specialname static class [runtime]System.Tuple`2[] get_array1() cil managed { .maxstack 8 @@ -261,8 +250,7 @@ IL_0005: ret } - .method public specialname static int32[0...,0...] - get_a3() cil managed + .method public specialname static int32[0...,0...] get_a3() cil managed { .maxstack 8 @@ -270,8 +258,7 @@ IL_0005: ret } - .method public specialname static int32[0...,0...,0...] - get_array3D() cil managed + .method public specialname static int32[0...,0...,0...] get_array3D() cil managed { .maxstack 8 @@ -279,8 +266,7 @@ IL_0005: ret } - .method public specialname static int32[0...,0...,0...,0...] - get_array4D() cil managed + .method public specialname static int32[0...,0...,0...,0...] get_array4D() cil managed { .maxstack 8 @@ -288,8 +274,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_a1() cil managed + .method public specialname static int32[] get_a1() cil managed { .maxstack 8 @@ -297,8 +282,7 @@ IL_0005: ret } - .method public specialname static int32[] - get_a2() cil managed + .method public specialname static int32[] get_a2() cil managed { .maxstack 8 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOn.il.bsl index 721b81b0430..b77d95c5722 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/CodeGenRenamings01.fs.RealInternalSignatureOn.il.bsl @@ -103,7 +103,7 @@ IL_002d: ldc.i4.1 IL_002e: ldc.i4.1 IL_002f: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) + !1) IL_0034: stfld class [runtime]System.Tuple`2 assembly/seq1@9::current IL_0039: ldc.i4.1 IL_003a: ret @@ -115,7 +115,7 @@ IL_0043: ldc.i4.2 IL_0044: ldc.i4.2 IL_0045: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) + !1) IL_004a: stfld class [runtime]System.Tuple`2 assembly/seq1@9::current IL_004f: ldc.i4.1 IL_0050: ret @@ -327,247 +327,269 @@ { .maxstack 8 - .locals init (int32 V_0, - class [runtime]System.Tuple`4 V_1, - class [runtime]System.Tuple`4 V_2, + .locals init (valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_0, + uint64 V_1, + int32 V_2, int32 V_3, - class [runtime]System.Tuple`3 V_4, - class [runtime]System.Tuple`3 V_5, + class [runtime]System.Tuple`4 V_4, + class [runtime]System.Tuple`4 V_5, int32 V_6, - class [runtime]System.Tuple`4 V_7, - class [runtime]System.Tuple`4 V_8, - int32 V_9) - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.s 10 - IL_0004: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0009: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000e: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0013: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::alist@5 - IL_0018: ldc.i4.3 - IL_0019: newarr [runtime]System.Int32 - IL_001e: dup - IL_001f: ldc.i4.0 - IL_0020: ldc.i4.1 - IL_0021: stelem [runtime]System.Int32 - IL_0026: dup - IL_0027: ldc.i4.1 - IL_0028: ldc.i4.2 - IL_0029: stelem [runtime]System.Int32 - IL_002e: dup - IL_002f: ldc.i4.2 - IL_0030: ldc.i4.3 - IL_0031: stelem [runtime]System.Int32 - IL_0036: stsfld int32[] assembly::array@6 - IL_003b: ldc.i4.1 - IL_003c: ldc.i4.1 - IL_003d: ldc.i4.s 10 - IL_003f: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0044: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0049: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 assembly::aseq@7 + class [runtime]System.Tuple`3 V_7, + class [runtime]System.Tuple`3 V_8, + int32 V_9, + class [runtime]System.Tuple`4 V_10, + class [runtime]System.Tuple`4 V_11, + int32 V_12) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.1 + IL_0003: ldc.i4.1 + IL_0004: stloc.2 + IL_0005: br.s IL_0019 + + IL_0007: ldloca.s V_0 + IL_0009: ldloc.2 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.2 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.2 + IL_0014: ldloc.1 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.1 + IL_0019: ldloc.1 + IL_001a: ldc.i4.s 10 + IL_001c: conv.i8 + IL_001d: blt.un.s IL_0007 + + IL_001f: ldloca.s V_0 + IL_0021: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0026: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::alist@5 + IL_002b: ldc.i4.3 + IL_002c: newarr [runtime]System.Int32 + IL_0031: dup + IL_0032: ldc.i4.0 + IL_0033: ldc.i4.1 + IL_0034: stelem [runtime]System.Int32 + IL_0039: dup + IL_003a: ldc.i4.1 + IL_003b: ldc.i4.2 + IL_003c: stelem [runtime]System.Int32 + IL_0041: dup + IL_0042: ldc.i4.2 + IL_0043: ldc.i4.3 + IL_0044: stelem [runtime]System.Int32 + IL_0049: stsfld int32[] assembly::array@6 IL_004e: ldc.i4.1 IL_004f: ldc.i4.1 - IL_0050: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_0055: ldc.i4.2 - IL_0056: ldc.i4.2 - IL_0057: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_005c: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() - IL_0061: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_0066: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_006b: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::list1@8 - IL_0070: ldc.i4.0 - IL_0071: ldnull - IL_0072: newobj instance void assembly/seq1@9::.ctor(int32, - class [runtime]System.Tuple`2) - IL_0077: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> assembly::seq1@9 - IL_007c: ldc.i4.2 - IL_007d: newarr class [runtime]System.Tuple`2 - IL_0082: dup + IL_0050: ldc.i4.s 10 + IL_0052: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, + int32, + int32) + IL_0057: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_005c: stsfld class [runtime]System.Collections.Generic.IEnumerable`1 assembly::aseq@7 + IL_0061: ldc.i4.1 + IL_0062: ldc.i4.1 + IL_0063: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_0068: ldc.i4.2 + IL_0069: ldc.i4.2 + IL_006a: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_006f: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::get_Empty() + IL_0074: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0079: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>::Cons(!0, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_007e: stsfld class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::list1@8 IL_0083: ldc.i4.0 - IL_0084: ldc.i4.1 - IL_0085: ldc.i4.1 - IL_0086: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_008b: stelem class [runtime]System.Tuple`2 - IL_0090: dup - IL_0091: ldc.i4.1 - IL_0092: ldc.i4.2 - IL_0093: ldc.i4.2 - IL_0094: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, - !1) - IL_0099: stelem class [runtime]System.Tuple`2 - IL_009e: stsfld class [runtime]System.Tuple`2[] assembly::array1@10 - IL_00a3: ldc.i4.2 - IL_00a4: ldc.i4.2 - IL_00a5: ldc.i4.0 - IL_00a6: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, + IL_0084: ldnull + IL_0085: newobj instance void assembly/seq1@9::.ctor(int32, + class [runtime]System.Tuple`2) + IL_008a: stsfld class [runtime]System.Collections.Generic.IEnumerable`1> assembly::seq1@9 + IL_008f: ldc.i4.2 + IL_0090: newarr class [runtime]System.Tuple`2 + IL_0095: dup + IL_0096: ldc.i4.0 + IL_0097: ldc.i4.1 + IL_0098: ldc.i4.1 + IL_0099: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_009e: stelem class [runtime]System.Tuple`2 + IL_00a3: dup + IL_00a4: ldc.i4.1 + IL_00a5: ldc.i4.2 + IL_00a6: ldc.i4.2 + IL_00a7: newobj instance void class [runtime]System.Tuple`2::.ctor(!0, + !1) + IL_00ac: stelem class [runtime]System.Tuple`2 + IL_00b1: stsfld class [runtime]System.Tuple`2[] assembly::array1@10 + IL_00b6: ldc.i4.2 + IL_00b7: ldc.i4.2 + IL_00b8: ldc.i4.0 + IL_00b9: call !!0[0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Create(int32, int32, !!0) - IL_00ab: stsfld int32[0...,0...] assembly::a3@11 - IL_00b0: ldc.i4.3 - IL_00b1: ldc.i4.3 - IL_00b2: ldc.i4.3 - IL_00b3: ldc.i4.0 - IL_00b4: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, + IL_00be: stsfld int32[0...,0...] assembly::a3@11 + IL_00c3: ldc.i4.3 + IL_00c4: ldc.i4.3 + IL_00c5: ldc.i4.3 + IL_00c6: ldc.i4.0 + IL_00c7: call !!0[0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Create(int32, int32, int32, !!0) - IL_00b9: stsfld int32[0...,0...,0...] assembly::array3D@12 - IL_00be: ldc.i4.4 - IL_00bf: ldc.i4.4 - IL_00c0: ldc.i4.4 - IL_00c1: ldc.i4.4 - IL_00c2: ldc.i4.0 - IL_00c3: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, + IL_00cc: stsfld int32[0...,0...,0...] assembly::array3D@12 + IL_00d1: ldc.i4.4 + IL_00d2: ldc.i4.4 + IL_00d3: ldc.i4.4 + IL_00d4: ldc.i4.4 + IL_00d5: ldc.i4.0 + IL_00d6: call !!0[0...,0...,0...,0...] [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Create(int32, int32, int32, int32, !!0) - IL_00c8: stsfld int32[0...,0...,0...,0...] assembly::array4D@13 - IL_00cd: call int32[] assembly::get_array() - IL_00d2: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) - IL_00d7: pop - IL_00d8: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_00dd: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_00e2: pop - IL_00e3: call class [runtime]System.Tuple`2[] assembly::get_array1() - IL_00e8: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) - IL_00ed: pop - IL_00ee: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() - IL_00f3: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) - IL_00f8: pop - IL_00f9: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() - IL_00fe: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) - IL_0103: pop - IL_0104: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() - IL_0109: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) - IL_010e: stsfld int32[] assembly::a1@25 - IL_0113: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() - IL_0118: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_011d: stsfld int32[] assembly::a2@26 - IL_0122: call int32[] assembly::get_a1() - IL_0127: ldc.i4.0 - IL_0128: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], + IL_00db: stsfld int32[0...,0...,0...,0...] assembly::array4D@13 + IL_00e0: call int32[] assembly::get_array() + IL_00e5: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfArray(!!0[]) + IL_00ea: pop + IL_00eb: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_00f0: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.ListModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_00f5: pop + IL_00f6: call class [runtime]System.Tuple`2[] assembly::get_array1() + IL_00fb: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfArray(class [runtime]System.Tuple`2[]) + IL_0100: pop + IL_0101: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1> assembly::get_list1() + IL_0106: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1>) + IL_010b: pop + IL_010c: call class [runtime]System.Collections.Generic.IEnumerable`1> assembly::get_seq1() + IL_0111: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpMap`2 [FSharp.Core]Microsoft.FSharp.Collections.MapModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1>) + IL_0116: pop + IL_0117: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 assembly::get_alist() + IL_011c: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfList(class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1) + IL_0121: stsfld int32[] assembly::a1@25 + IL_0126: call class [runtime]System.Collections.Generic.IEnumerable`1 assembly::get_aseq() + IL_012b: call !!0[] [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::OfSeq(class [runtime]System.Collections.Generic.IEnumerable`1) + IL_0130: stsfld int32[] assembly::a2@26 + IL_0135: call int32[] assembly::get_a1() + IL_013a: ldc.i4.0 + IL_013b: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Get(!!0[], int32) - IL_012d: stloc.0 - IL_012e: call int32[] assembly::get_a2() - IL_0133: ldc.i4.0 - IL_0134: ldloc.0 - IL_0135: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], + IL_0140: stloc.3 + IL_0141: call int32[] assembly::get_a2() + IL_0146: ldc.i4.0 + IL_0147: ldloc.3 + IL_0148: call void [FSharp.Core]Microsoft.FSharp.Collections.ArrayModule::Set(!!0[], int32, !!0) - IL_013a: nop - IL_013b: call int32[0...,0...] assembly::get_a3() - IL_0140: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) - IL_0145: call int32[0...,0...] assembly::get_a3() - IL_014a: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) - IL_014f: call int32[0...,0...] assembly::get_a3() - IL_0154: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) - IL_0159: call int32[0...,0...] assembly::get_a3() - IL_015e: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) - IL_0163: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, - !1, - !2, - !3) - IL_0168: stloc.1 - IL_0169: ldloc.1 - IL_016a: stloc.2 - IL_016b: call int32[0...,0...] assembly::get_a3() - IL_0170: ldc.i4.0 - IL_0171: ldc.i4.0 - IL_0172: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], + IL_014d: nop + IL_014e: call int32[0...,0...] assembly::get_a3() + IL_0153: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length1(!!0[0...,0...]) + IL_0158: call int32[0...,0...] assembly::get_a3() + IL_015d: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Length2(!!0[0...,0...]) + IL_0162: call int32[0...,0...] assembly::get_a3() + IL_0167: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base1(!!0[0...,0...]) + IL_016c: call int32[0...,0...] assembly::get_a3() + IL_0171: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Base2(!!0[0...,0...]) + IL_0176: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + !1, + !2, + !3) + IL_017b: stloc.s V_4 + IL_017d: ldloc.s V_4 + IL_017f: stloc.s V_5 + IL_0181: call int32[0...,0...] assembly::get_a3() + IL_0186: ldc.i4.0 + IL_0187: ldc.i4.0 + IL_0188: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Get(!!0[0...,0...], int32, int32) - IL_0177: stloc.3 - IL_0178: call int32[0...,0...] assembly::get_a3() - IL_017d: ldc.i4.0 - IL_017e: ldc.i4.0 - IL_017f: ldloc.3 - IL_0180: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], + IL_018d: stloc.s V_6 + IL_018f: call int32[0...,0...] assembly::get_a3() + IL_0194: ldc.i4.0 + IL_0195: ldc.i4.0 + IL_0196: ldloc.s V_6 + IL_0198: call void [FSharp.Core]Microsoft.FSharp.Collections.Array2DModule::Set(!!0[0...,0...], int32, int32, !!0) - IL_0185: nop - IL_0186: call int32[0...,0...,0...] assembly::get_array3D() - IL_018b: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) - IL_0190: call int32[0...,0...,0...] assembly::get_array3D() - IL_0195: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) - IL_019a: call int32[0...,0...,0...] assembly::get_array3D() - IL_019f: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) - IL_01a4: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, - !1, - !2) - IL_01a9: stloc.s V_4 - IL_01ab: ldloc.s V_4 - IL_01ad: stloc.s V_5 - IL_01af: call int32[0...,0...,0...] assembly::get_array3D() - IL_01b4: ldc.i4.0 - IL_01b5: ldc.i4.0 - IL_01b6: ldc.i4.0 - IL_01b7: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], + IL_019d: nop + IL_019e: call int32[0...,0...,0...] assembly::get_array3D() + IL_01a3: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length1(!!0[0...,0...,0...]) + IL_01a8: call int32[0...,0...,0...] assembly::get_array3D() + IL_01ad: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length2(!!0[0...,0...,0...]) + IL_01b2: call int32[0...,0...,0...] assembly::get_array3D() + IL_01b7: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Length3(!!0[0...,0...,0...]) + IL_01bc: newobj instance void class [runtime]System.Tuple`3::.ctor(!0, + !1, + !2) + IL_01c1: stloc.s V_7 + IL_01c3: ldloc.s V_7 + IL_01c5: stloc.s V_8 + IL_01c7: call int32[0...,0...,0...] assembly::get_array3D() + IL_01cc: ldc.i4.0 + IL_01cd: ldc.i4.0 + IL_01ce: ldc.i4.0 + IL_01cf: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Get(!!0[0...,0...,0...], int32, int32, int32) - IL_01bc: stloc.s V_6 - IL_01be: call int32[0...,0...,0...] assembly::get_array3D() - IL_01c3: ldc.i4.0 - IL_01c4: ldc.i4.0 - IL_01c5: ldc.i4.0 - IL_01c6: ldloc.s V_6 - IL_01c8: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], + IL_01d4: stloc.s V_9 + IL_01d6: call int32[0...,0...,0...] assembly::get_array3D() + IL_01db: ldc.i4.0 + IL_01dc: ldc.i4.0 + IL_01dd: ldc.i4.0 + IL_01de: ldloc.s V_9 + IL_01e0: call void [FSharp.Core]Microsoft.FSharp.Collections.Array3DModule::Set(!!0[0...,0...,0...], int32, int32, int32, !!0) - IL_01cd: nop - IL_01ce: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_01d3: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) - IL_01d8: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_01dd: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) - IL_01e2: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_01e7: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) - IL_01ec: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_01f1: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) - IL_01f6: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, - !1, - !2, - !3) - IL_01fb: stloc.s V_7 - IL_01fd: ldloc.s V_7 - IL_01ff: stloc.s V_8 - IL_0201: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0206: ldc.i4.0 - IL_0207: ldc.i4.0 - IL_0208: ldc.i4.0 - IL_0209: ldc.i4.0 - IL_020a: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], + IL_01e5: nop + IL_01e6: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_01eb: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length1(!!0[0...,0...,0...,0...]) + IL_01f0: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_01f5: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length2(!!0[0...,0...,0...,0...]) + IL_01fa: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_01ff: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length3(!!0[0...,0...,0...,0...]) + IL_0204: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_0209: call int32 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Length4(!!0[0...,0...,0...,0...]) + IL_020e: newobj instance void class [runtime]System.Tuple`4::.ctor(!0, + !1, + !2, + !3) + IL_0213: stloc.s V_10 + IL_0215: ldloc.s V_10 + IL_0217: stloc.s V_11 + IL_0219: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_021e: ldc.i4.0 + IL_021f: ldc.i4.0 + IL_0220: ldc.i4.0 + IL_0221: ldc.i4.0 + IL_0222: call !!0 [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Get(!!0[0...,0...,0...,0...], int32, int32, int32, int32) - IL_020f: stloc.s V_9 - IL_0211: call int32[0...,0...,0...,0...] assembly::get_array4D() - IL_0216: ldc.i4.0 - IL_0217: ldc.i4.0 - IL_0218: ldc.i4.0 - IL_0219: ldc.i4.0 - IL_021a: ldloc.s V_9 - IL_021c: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], + IL_0227: stloc.s V_12 + IL_0229: call int32[0...,0...,0...,0...] assembly::get_array4D() + IL_022e: ldc.i4.0 + IL_022f: ldc.i4.0 + IL_0230: ldc.i4.0 + IL_0231: ldc.i4.0 + IL_0232: ldloc.s V_12 + IL_0234: call void [FSharp.Core]Microsoft.FSharp.Collections.Array4DModule::Set(!!0[0...,0...,0...,0...], int32, int32, int32, int32, !!0) - IL_0221: nop - IL_0222: ret + IL_0239: nop + IL_023a: ret } .property class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.RealInternalSignatureOn.il.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.RealInternalSignatureOn.il.bsl index 214395fe6ad..8fd7c519810 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.RealInternalSignatureOn.il.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/ForLoop01.fs.RealInternalSignatureOn.il.bsl @@ -57,42 +57,64 @@ .method assembly specialname static void staticInitialization@() cil managed { - .maxstack 5 + .maxstack 4 .locals init (class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_0, - class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_1, - int32 V_2) - IL_0000: ldc.i4.1 - IL_0001: ldc.i4.1 - IL_0002: ldc.i4.3 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators::CreateSequence(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_000d: call class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 [FSharp.Core]Microsoft.FSharp.Collections.SeqModule::ToList(class [runtime]System.Collections.Generic.IEnumerable`1) - IL_0012: stloc.0 - IL_0013: ldloc.0 - IL_0014: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0019: stloc.1 - IL_001a: br.s IL_0042 - - IL_001c: ldloc.0 - IL_001d: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() - IL_0022: stloc.2 - IL_0023: ldstr "%A" - IL_0028: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) - IL_002d: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) - IL_0032: ldloc.2 - IL_0033: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) - IL_0038: pop - IL_0039: ldloc.1 - IL_003a: stloc.0 - IL_003b: ldloc.0 - IL_003c: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() - IL_0041: stloc.1 - IL_0042: ldloc.1 - IL_0043: brtrue.s IL_001c - - IL_0045: ret + valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1 V_1, + uint64 V_2, + int32 V_3, + class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 V_4, + int32 V_5) + IL_0000: ldc.i4.0 + IL_0001: conv.i8 + IL_0002: stloc.2 + IL_0003: ldc.i4.1 + IL_0004: stloc.3 + IL_0005: br.s IL_0019 + + IL_0007: ldloca.s V_1 + IL_0009: ldloc.3 + IL_000a: call instance void valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Add(!0) + IL_000f: nop + IL_0010: ldloc.3 + IL_0011: ldc.i4.1 + IL_0012: add + IL_0013: stloc.3 + IL_0014: ldloc.2 + IL_0015: ldc.i4.1 + IL_0016: conv.i8 + IL_0017: add + IL_0018: stloc.2 + IL_0019: ldloc.2 + IL_001a: ldc.i4.3 + IL_001b: conv.i8 + IL_001c: blt.un.s IL_0007 + + IL_001e: ldloca.s V_1 + IL_0020: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 valuetype [FSharp.Core]Microsoft.FSharp.Core.CompilerServices.ListCollector`1::Close() + IL_0025: stloc.0 + IL_0026: ldloc.0 + IL_0027: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_002c: stloc.s V_4 + IL_002e: br.s IL_005a + + IL_0030: ldloc.0 + IL_0031: call instance !0 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_HeadOrDefault() + IL_0036: stloc.s V_5 + IL_0038: ldstr "%A" + IL_003d: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,int32>::.ctor(string) + IL_0042: call !!0 [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::PrintFormatLine>(class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4) + IL_0047: ldloc.s V_5 + IL_0049: callvirt instance !1 class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2::Invoke(!0) + IL_004e: pop + IL_004f: ldloc.s V_4 + IL_0051: stloc.0 + IL_0052: ldloc.0 + IL_0053: call instance class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1 class [FSharp.Core]Microsoft.FSharp.Collections.FSharpList`1::get_TailOrNull() + IL_0058: stloc.s V_4 + IL_005a: ldloc.s V_4 + IL_005c: brtrue.s IL_0030 + + IL_005e: ret } } diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs index 5e8206137b1..3516864c122 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/Misc/Misc.fs @@ -45,6 +45,7 @@ module Misc = let ``CodeGenRenamings01_RealInternalSignatureOn_fs`` compilation = compilation |> withRealInternalSignatureOn + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> asExe |> verifyCompilation @@ -116,6 +117,7 @@ module Misc = let ``ForLoop01_RealInternalSignatureOn_fs`` compilation = compilation |> withRealInternalSignatureOn + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> asExe |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs index 3b748e2be23..10346caac2a 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionStepping.fs @@ -106,6 +106,7 @@ module SeqExpressionStepping = let ``SeqExpressionSteppingTest07_RealInternalSignatureOn_fs`` compilation = compilation |> withRealInternalSignatureOn + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation // SOURCE=SeqExpressionSteppingTest07.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd SeqExpressionSteppingTest7.exe" # SeqExpressionSteppingTest7.fs - @@ -113,4 +114,5 @@ module SeqExpressionStepping = let ``SeqExpressionSteppingTest07_RealInternalSignatureOff_fs`` compilation = compilation |> withRealInternalSignatureOff + |> withLangVersionPreview // TODO https://github.com/dotnet/fsharp/issues/16739: Remove this when LanguageFeature.LowerIntegralRangesToFastLoops is out of preview. |> verifyCompilation diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl index 86cc7e04485..155ad0265cc 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.net472.release.bsl @@ -419,113 +419,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl index bb5909fc008..3d78a971d68 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOff.il.netcore.release.bsl @@ -420,113 +420,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl index f0812837c64..66a9fd3e0d5 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.net472.release.bsl @@ -421,113 +421,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl index e3eea368d57..9be862b2fd6 100644 --- a/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl +++ b/tests/FSharp.Compiler.ComponentTests/EmittedIL/SeqExpressionStepping/SeqExpressionSteppingTest07.fs.RealInternalSignatureOn.il.netcore.release.bsl @@ -422,113 +422,119 @@ int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0029 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldloc.1 - IL_002a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_002f: brtrue.s IL_0012 - - IL_0031: leave.s IL_0045 + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0034 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldloc.2 + IL_002c: ldc.i4.m1 + IL_002d: add + IL_002e: stloc.2 + IL_002f: ldloc.1 + IL_0030: ldc.i4.1 + IL_0031: conv.i8 + IL_0032: add + IL_0033: stloc.1 + IL_0034: ldloc.1 + IL_0035: ldloc.0 + IL_0036: blt.un.s IL_0019 - } - finally - { - IL_0033: ldloc.1 - IL_0034: isinst [runtime]System.IDisposable - IL_0039: stloc.3 - IL_003a: ldloc.3 - IL_003b: brfalse.s IL_0044 - - IL_003d: ldloc.3 - IL_003e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0043: endfinally - IL_0044: endfinally - } - IL_0045: ret + IL_0038: ret } .method public static void testSimpleForEachIntRangeLoopDownWithTwoStatements(int32 start, int32 stop) cil managed { - .maxstack 5 - .locals init (class [runtime]System.Collections.Generic.IEnumerable`1 V_0, - class [runtime]System.Collections.Generic.IEnumerator`1 V_1, + .maxstack 4 + .locals init (uint64 V_0, + uint64 V_1, int32 V_2, - class [runtime]System.IDisposable V_3) + int32 V_3) IL_0000: ldarg.0 - IL_0001: ldc.i4.m1 - IL_0002: ldarg.1 - IL_0003: call class [runtime]System.Collections.Generic.IEnumerable`1 [FSharp.Core]Microsoft.FSharp.Core.Operators/OperatorIntrinsics::RangeInt32(int32, - int32, - int32) - IL_0008: stloc.0 - IL_0009: ldloc.0 - IL_000a: callvirt instance class [runtime]System.Collections.Generic.IEnumerator`1 class [runtime]System.Collections.Generic.IEnumerable`1::GetEnumerator() - IL_000f: stloc.1 - .try - { - IL_0010: br.s IL_0039 - - IL_0012: ldloc.1 - IL_0013: callvirt instance !0 class [runtime]System.Collections.Generic.IEnumerator`1::get_Current() - IL_0018: stloc.2 - IL_0019: ldstr "{0}" - IL_001e: ldloc.2 - IL_001f: box [runtime]System.Int32 - IL_0024: call void [runtime]System.Console::WriteLine(string, - object) - IL_0029: ldstr "{0}" - IL_002e: ldloc.2 - IL_002f: box [runtime]System.Int32 - IL_0034: call void [runtime]System.Console::WriteLine(string, - object) - IL_0039: ldloc.1 - IL_003a: callvirt instance bool [runtime]System.Collections.IEnumerator::MoveNext() - IL_003f: brtrue.s IL_0012 - - IL_0041: leave.s IL_0055 - - } - finally - { - IL_0043: ldloc.1 - IL_0044: isinst [runtime]System.IDisposable - IL_0049: stloc.3 - IL_004a: ldloc.3 - IL_004b: brfalse.s IL_0054 - - IL_004d: ldloc.3 - IL_004e: callvirt instance void [runtime]System.IDisposable::Dispose() - IL_0053: endfinally - IL_0054: endfinally - } - IL_0055: ret + 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_0011 + + IL_0009: ldarg.0 + IL_000a: ldarg.1 + IL_000b: sub + IL_000c: conv.i8 + 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_0044 + + IL_0019: ldloc.2 + IL_001a: stloc.3 + IL_001b: ldstr "{0}" + IL_0020: ldloc.3 + IL_0021: box [runtime]System.Int32 + IL_0026: call void [runtime]System.Console::WriteLine(string, + object) + IL_002b: ldstr "{0}" + IL_0030: ldloc.3 + IL_0031: box [runtime]System.Int32 + IL_0036: call void [runtime]System.Console::WriteLine(string, + object) + IL_003b: ldloc.2 + IL_003c: ldc.i4.m1 + IL_003d: add + IL_003e: stloc.2 + IL_003f: ldloc.1 + IL_0040: ldc.i4.1 + IL_0041: conv.i8 + IL_0042: add + IL_0043: stloc.1 + IL_0044: ldloc.1 + IL_0045: ldloc.0 + IL_0046: blt.un.s IL_0019 + + IL_0048: ret } .method public static void testSimpleForEachIntLoopWithOneStatement(int32 start, diff --git a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj index e1704555421..4f04946a466 100644 --- a/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj +++ b/tests/FSharp.Compiler.ComponentTests/FSharp.Compiler.ComponentTests.fsproj @@ -152,6 +152,7 @@ + diff --git a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs index 018f7419c97..b07b0d43999 100644 --- a/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs +++ b/tests/FSharp.Core.UnitTests/FSharp.Core/PrimTypes.fs @@ -821,7 +821,9 @@ module internal RangeTestsHelpers = enumerator.Current |> ignore let inline exceptions zero one two = + Assert.Throws (typeof, (fun () -> {one .. zero .. two} |> Seq.length |> ignore)) |> ignore Assert.Throws (typeof, (fun () -> [one .. zero .. two] |> List.length |> ignore)) |> ignore + Assert.Throws (typeof, (fun () -> [|one .. zero .. two|] |> Array.length |> ignore)) |> ignore Assert.Throws (typeof, (fun () -> regressionExceptionBeforeStartSingleStepRangeEnumerator zero one)) |> ignore Assert.Throws (typeof, (fun () -> regressionExceptionBeforeStartVariableStepIntegralRange zero two)) |> ignore @@ -829,31 +831,65 @@ module internal RangeTestsHelpers = Assert.Throws (typeof, (fun () -> regressionExceptionAfterEndVariableStepIntegralRange zero two)) |> ignore let inline common (min0, min1, min2, min3) (max0, max1, max2, max3) (zero, one, two, three) = + Assert.AreEqual ({min0 .. min3}, seq {yield min0; yield min1; yield min2; yield min3}) + Assert.AreEqual ({min0 .. one .. min3}, seq {min0; min1; min2; min3}) + Assert.AreEqual ({min0 .. two .. min3}, seq {min0; min2}) + Assert.AreEqual ({min0 .. three .. min3}, seq {min0; min3}) + Assert.AreEqual ([min0 .. min3], [min0; min1; min2; min3]) Assert.AreEqual ([min0 .. one .. min3], [min0; min1; min2; min3]) Assert.AreEqual ([min0 .. two .. min3], [min0; min2]) Assert.AreEqual ([min0 .. three .. min3], [min0; min3]) + Assert.AreEqual ([|min0 .. min3|], [|min0; min1; min2; min3|]) + Assert.AreEqual ([|min0 .. one .. min3|], [|min0; min1; min2; min3|]) + Assert.AreEqual ([|min0 .. two .. min3|], [|min0; min2|]) + Assert.AreEqual ([|min0 .. three .. min3|], [|min0; min3|]) + + Assert.AreEqual ({max3 .. max0}, seq {yield max3; yield max2; yield max1; yield max0}) + Assert.AreEqual ({max3 .. one .. max0}, seq {max3; max2; max1; max0}) + Assert.AreEqual ({max3 .. two .. max0}, seq {max3; max1}) + Assert.AreEqual ({max3 .. three .. max0}, seq {max3; max0}) + Assert.AreEqual ([max3 .. max0], [max3; max2; max1; max0]) Assert.AreEqual ([max3 .. one .. max0], [max3; max2; max1; max0]) Assert.AreEqual ([max3 .. two .. max0], [max3; max1]) Assert.AreEqual ([max3 .. three .. max0], [max3; max0]) + Assert.AreEqual ([|max3 .. max0|], [|max3; max2; max1; max0|]) + Assert.AreEqual ([|max3 .. one .. max0|], [|max3; max2; max1; max0|]) + Assert.AreEqual ([|max3 .. two .. max0|], [|max3; max1|]) + Assert.AreEqual ([|max3 .. three .. max0|], [|max3; max0|]) + + Assert.AreEqual ({max0 .. min0}, Seq.empty) + Assert.AreEqual ({max0 .. one .. min0}, Seq.empty) + Assert.AreEqual ({max0 .. two .. min0}, Seq.empty) + Assert.AreEqual ({max0 .. three .. min0}, Seq.empty) + Assert.AreEqual ([max0 .. min0], []) Assert.AreEqual ([max0 .. one .. min0], []) Assert.AreEqual ([max0 .. two .. min0], []) Assert.AreEqual ([max0 .. three .. min0], []) + Assert.AreEqual ([|max0 .. min0|], [||]) + Assert.AreEqual ([|max0 .. one .. min0|], [||]) + Assert.AreEqual ([|max0 .. two .. min0|], [||]) + Assert.AreEqual ([|max0 .. three .. min0|], [||]) + exceptions zero one two // tests for singleStepRangeEnumerator, as it only is used if start and/or end are not the // minimum or maximum of the number range and it is counting by 1s + Assert.AreEqual ({min1 .. min3}, seq {min1; min2; min3}) + Assert.AreEqual ({max3 .. max1}, seq {max3; max2; max1}) + Assert.AreEqual ([min1 .. min3], [min1; min2; min3]) Assert.AreEqual ([max3 .. max1], [max3; max2; max1]) - let inline signed min0 max0 = - let zero = LanguagePrimitives.GenericZero - let one = LanguagePrimitives.GenericOne + Assert.AreEqual ([|min1 .. min3|], [|min1; min2; min3|]) + Assert.AreEqual ([|max3 .. max1|], [|max3; max2; max1|]) + + let inline signed zero one min0 max0 = let two = one + one let three = two + one @@ -867,31 +903,73 @@ module internal RangeTestsHelpers = common (min0, min1, min2, min3) (max0, max1, max2, max3) (zero, one, two, three) + Assert.AreEqual ({min0 .. max0 .. max0}, seq { min0; min0 + max0; min0 + max0 + max0 }) + Assert.AreEqual ({min0 .. max1 .. max0}, seq { min0; min0 + max1; min0 + max1 + max1 }) + Assert.AreEqual ({min0 .. max2 .. max0}, seq { min0; min0 + max2; min0 + max2 + max2 }) + Assert.AreEqual ({min0 .. max3 .. max0}, seq { min0; min0 + max3; min0 + max3 + max3 }) + Assert.AreEqual ([min0 .. max0 .. max0], [ min0; min0 + max0; min0 + max0 + max0 ]) Assert.AreEqual ([min0 .. max1 .. max0], [ min0; min0 + max1; min0 + max1 + max1 ]) Assert.AreEqual ([min0 .. max2 .. max0], [ min0; min0 + max2; min0 + max2 + max2 ]) Assert.AreEqual ([min0 .. max3 .. max0], [ min0; min0 + max3; min0 + max3 + max3 ]) + Assert.AreEqual ([|min0 .. max0 .. max0|], [| min0; min0 + max0; min0 + max0 + max0 |]) + Assert.AreEqual ([|min0 .. max1 .. max0|], [| min0; min0 + max1; min0 + max1 + max1 |]) + Assert.AreEqual ([|min0 .. max2 .. max0|], [| min0; min0 + max2; min0 + max2 + max2 |]) + Assert.AreEqual ([|min0 .. max3 .. max0|], [| min0; min0 + max3; min0 + max3 + max3 |]) + + Assert.AreEqual ({min3 .. -one .. min0}, seq {min3; min2; min1; min0}) + Assert.AreEqual ({min3 .. -two .. min0}, seq {min3; min1}) + Assert.AreEqual ({min3 .. -three .. min0}, seq {min3; min0}) + Assert.AreEqual ([min3 .. -one .. min0], [min3; min2; min1; min0]) Assert.AreEqual ([min3 .. -two .. min0], [min3; min1]) Assert.AreEqual ([min3 .. -three .. min0], [min3; min0]) + Assert.AreEqual ([|min3 .. -one .. min0|], [|min3; min2; min1; min0|]) + Assert.AreEqual ([|min3 .. -two .. min0|], [|min3; min1|]) + Assert.AreEqual ([|min3 .. -three .. min0|], [|min3; min0|]) + + Assert.AreEqual ({max0 .. -one .. max3}, seq {max0; max1; max2; max3}) + Assert.AreEqual ({max0 .. -two .. max3}, seq {max0; max2}) + Assert.AreEqual ({max0 .. -three .. max3}, seq {max0; max3}) + Assert.AreEqual ([max0 .. -one .. max3], [max0; max1; max2; max3]) Assert.AreEqual ([max0 .. -two .. max3], [max0; max2]) Assert.AreEqual ([max0 .. -three .. max3], [max0; max3]) + Assert.AreEqual ([|max0 .. -one .. max3|], [|max0; max1; max2; max3|]) + Assert.AreEqual ([|max0 .. -two .. max3|], [|max0; max2|]) + Assert.AreEqual ([|max0 .. -three .. max3|], [|max0; max3|]) + + Assert.AreEqual ({min0 .. -one .. max0}, Seq.empty) + Assert.AreEqual ({min0 .. -two .. max0}, Seq.empty) + Assert.AreEqual ({min0 .. -three .. max0}, Seq.empty) + Assert.AreEqual ([min0 .. -one .. max0], []) Assert.AreEqual ([min0 .. -two .. max0], []) Assert.AreEqual ([min0 .. -three .. max0], []) + Assert.AreEqual ([|min0 .. -one .. max0|], [||]) + Assert.AreEqual ([|min0 .. -two .. max0|], [||]) + Assert.AreEqual ([|min0 .. -three .. max0|], [||]) + + Assert.AreEqual ({max0 .. min0 .. min0}, seq {max0; max0 + min0}) + Assert.AreEqual ({max0 .. min1 .. min0}, seq {max0; max0 + min1; max0 + min1 + min1 }) + Assert.AreEqual ({max0 .. min2 .. min0}, seq {max0; max0 + min2; max0 + min2 + min2 }) + Assert.AreEqual ({max0 .. min3 .. min0}, seq {max0; max0 + min3; max0 + min3 + min3 }) + Assert.AreEqual ([max0 .. min0 .. min0], [max0; max0 + min0]) Assert.AreEqual ([max0 .. min1 .. min0], [max0; max0 + min1; max0 + min1 + min1 ]) Assert.AreEqual ([max0 .. min2 .. min0], [max0; max0 + min2; max0 + min2 + min2 ]) Assert.AreEqual ([max0 .. min3 .. min0], [max0; max0 + min3; max0 + min3 + min3 ]) - let inline unsigned min0 max0 = - let zero = LanguagePrimitives.GenericZero - let one = LanguagePrimitives.GenericOne + Assert.AreEqual ([|max0 .. min0 .. min0|], [|max0; max0 + min0|]) + Assert.AreEqual ([|max0 .. min1 .. min0|], [|max0; max0 + min1; max0 + min1 + min1 |]) + Assert.AreEqual ([|max0 .. min2 .. min0|], [|max0; max0 + min2; max0 + min2 + min2 |]) + Assert.AreEqual ([|max0 .. min3 .. min0|], [|max0; max0 + min3; max0 + min3 + min3 |]) + + let inline unsigned zero one min0 max0 = let two = one + one let three = two + one @@ -905,32 +983,238 @@ module internal RangeTestsHelpers = common (min0, min1, min2, min3) (max0, max1, max2, max3) (zero, one, two, three) + Assert.AreEqual ({min0 .. max0 .. max0}, seq {yield min0; yield min0 + max0}) + Assert.AreEqual ({min0 .. max1 .. max0}, seq {min0; min0 + max1}) + Assert.AreEqual ({min0 .. max2 .. max0}, seq {min0; min0 + max2}) + Assert.AreEqual ({min0 .. max3 .. max0}, seq {min0; min0 + max3}) + Assert.AreEqual ([min0 .. max0 .. max0], [min0; min0 + max0]) Assert.AreEqual ([min0 .. max1 .. max0], [min0; min0 + max1]) Assert.AreEqual ([min0 .. max2 .. max0], [min0; min0 + max2]) Assert.AreEqual ([min0 .. max3 .. max0], [min0; min0 + max3]) + Assert.AreEqual ([|min0 .. max0 .. max0|], [|min0; min0 + max0|]) + Assert.AreEqual ([|min0 .. max1 .. max0|], [|min0; min0 + max1|]) + Assert.AreEqual ([|min0 .. max2 .. max0|], [|min0; min0 + max2|]) + Assert.AreEqual ([|min0 .. max3 .. max0|], [|min0; min0 + max3|]) + +// Note to future contributors: if the code gen for ranges is not correct, +// some of these tests may loop forever or use up all available memory instead of failing outright. +module RangeTests = + /// [|Byte.MinValue..Byte.MaxValue|] + let allBytesArray = + [| + 0x00uy; 0x01uy; 0x02uy; 0x03uy; 0x04uy; 0x05uy; 0x06uy; 0x07uy; 0x08uy; 0x09uy; 0x0auy; 0x0buy; 0x0cuy; 0x0duy; 0x0euy; 0x0fuy + 0x10uy; 0x11uy; 0x12uy; 0x13uy; 0x14uy; 0x15uy; 0x16uy; 0x17uy; 0x18uy; 0x19uy; 0x1auy; 0x1buy; 0x1cuy; 0x1duy; 0x1euy; 0x1fuy + 0x20uy; 0x21uy; 0x22uy; 0x23uy; 0x24uy; 0x25uy; 0x26uy; 0x27uy; 0x28uy; 0x29uy; 0x2auy; 0x2buy; 0x2cuy; 0x2duy; 0x2euy; 0x2fuy + 0x30uy; 0x31uy; 0x32uy; 0x33uy; 0x34uy; 0x35uy; 0x36uy; 0x37uy; 0x38uy; 0x39uy; 0x3auy; 0x3buy; 0x3cuy; 0x3duy; 0x3euy; 0x3fuy + 0x40uy; 0x41uy; 0x42uy; 0x43uy; 0x44uy; 0x45uy; 0x46uy; 0x47uy; 0x48uy; 0x49uy; 0x4auy; 0x4buy; 0x4cuy; 0x4duy; 0x4euy; 0x4fuy + 0x50uy; 0x51uy; 0x52uy; 0x53uy; 0x54uy; 0x55uy; 0x56uy; 0x57uy; 0x58uy; 0x59uy; 0x5auy; 0x5buy; 0x5cuy; 0x5duy; 0x5euy; 0x5fuy + 0x60uy; 0x61uy; 0x62uy; 0x63uy; 0x64uy; 0x65uy; 0x66uy; 0x67uy; 0x68uy; 0x69uy; 0x6auy; 0x6buy; 0x6cuy; 0x6duy; 0x6euy; 0x6fuy + 0x70uy; 0x71uy; 0x72uy; 0x73uy; 0x74uy; 0x75uy; 0x76uy; 0x77uy; 0x78uy; 0x79uy; 0x7auy; 0x7buy; 0x7cuy; 0x7duy; 0x7euy; 0x7fuy + 0x80uy; 0x81uy; 0x82uy; 0x83uy; 0x84uy; 0x85uy; 0x86uy; 0x87uy; 0x88uy; 0x89uy; 0x8auy; 0x8buy; 0x8cuy; 0x8duy; 0x8euy; 0x8fuy + 0x90uy; 0x91uy; 0x92uy; 0x93uy; 0x94uy; 0x95uy; 0x96uy; 0x97uy; 0x98uy; 0x99uy; 0x9auy; 0x9buy; 0x9cuy; 0x9duy; 0x9euy; 0x9fuy + 0xa0uy; 0xa1uy; 0xa2uy; 0xa3uy; 0xa4uy; 0xa5uy; 0xa6uy; 0xa7uy; 0xa8uy; 0xa9uy; 0xaauy; 0xabuy; 0xacuy; 0xaduy; 0xaeuy; 0xafuy + 0xb0uy; 0xb1uy; 0xb2uy; 0xb3uy; 0xb4uy; 0xb5uy; 0xb6uy; 0xb7uy; 0xb8uy; 0xb9uy; 0xbauy; 0xbbuy; 0xbcuy; 0xbduy; 0xbeuy; 0xbfuy + 0xc0uy; 0xc1uy; 0xc2uy; 0xc3uy; 0xc4uy; 0xc5uy; 0xc6uy; 0xc7uy; 0xc8uy; 0xc9uy; 0xcauy; 0xcbuy; 0xccuy; 0xcduy; 0xceuy; 0xcfuy + 0xd0uy; 0xd1uy; 0xd2uy; 0xd3uy; 0xd4uy; 0xd5uy; 0xd6uy; 0xd7uy; 0xd8uy; 0xd9uy; 0xdauy; 0xdbuy; 0xdcuy; 0xdduy; 0xdeuy; 0xdfuy + 0xe0uy; 0xe1uy; 0xe2uy; 0xe3uy; 0xe4uy; 0xe5uy; 0xe6uy; 0xe7uy; 0xe8uy; 0xe9uy; 0xeauy; 0xebuy; 0xecuy; 0xeduy; 0xeeuy; 0xefuy + 0xf0uy; 0xf1uy; 0xf2uy; 0xf3uy; 0xf4uy; 0xf5uy; 0xf6uy; 0xf7uy; 0xf8uy; 0xf9uy; 0xfauy; 0xfbuy; 0xfcuy; 0xfduy; 0xfeuy; 0xffuy + |] + + /// [Byte.MinValue..Byte.MaxValue] + let allBytesList = List.ofArray allBytesArray + + /// {Byte.MinValue..Byte.MaxValue} + let allBytesSeq = Seq.ofArray allBytesArray + + /// [|SByte.MinValue..SByte.MaxValue|] + let allSBytesArray = + [| + 0x80y; 0x81y; 0x82y; 0x83y; 0x84y; 0x85y; 0x86y; 0x87y; 0x88y; 0x89y; 0x8ay; 0x8by; 0x8cy; 0x8dy; 0x8ey; 0x8fy + 0x90y; 0x91y; 0x92y; 0x93y; 0x94y; 0x95y; 0x96y; 0x97y; 0x98y; 0x99y; 0x9ay; 0x9by; 0x9cy; 0x9dy; 0x9ey; 0x9fy + 0xa0y; 0xa1y; 0xa2y; 0xa3y; 0xa4y; 0xa5y; 0xa6y; 0xa7y; 0xa8y; 0xa9y; 0xaay; 0xaby; 0xacy; 0xady; 0xaey; 0xafy + 0xb0y; 0xb1y; 0xb2y; 0xb3y; 0xb4y; 0xb5y; 0xb6y; 0xb7y; 0xb8y; 0xb9y; 0xbay; 0xbby; 0xbcy; 0xbdy; 0xbey; 0xbfy + 0xc0y; 0xc1y; 0xc2y; 0xc3y; 0xc4y; 0xc5y; 0xc6y; 0xc7y; 0xc8y; 0xc9y; 0xcay; 0xcby; 0xccy; 0xcdy; 0xcey; 0xcfy + 0xd0y; 0xd1y; 0xd2y; 0xd3y; 0xd4y; 0xd5y; 0xd6y; 0xd7y; 0xd8y; 0xd9y; 0xday; 0xdby; 0xdcy; 0xddy; 0xdey; 0xdfy + 0xe0y; 0xe1y; 0xe2y; 0xe3y; 0xe4y; 0xe5y; 0xe6y; 0xe7y; 0xe8y; 0xe9y; 0xeay; 0xeby; 0xecy; 0xedy; 0xeey; 0xefy + 0xf0y; 0xf1y; 0xf2y; 0xf3y; 0xf4y; 0xf5y; 0xf6y; 0xf7y; 0xf8y; 0xf9y; 0xfay; 0xfby; 0xfcy; 0xfdy; 0xfey; 0xffy + 0x00y; 0x01y; 0x02y; 0x03y; 0x04y; 0x05y; 0x06y; 0x07y; 0x08y; 0x09y; 0x0ay; 0x0by; 0x0cy; 0x0dy; 0x0ey; 0x0fy + 0x10y; 0x11y; 0x12y; 0x13y; 0x14y; 0x15y; 0x16y; 0x17y; 0x18y; 0x19y; 0x1ay; 0x1by; 0x1cy; 0x1dy; 0x1ey; 0x1fy + 0x20y; 0x21y; 0x22y; 0x23y; 0x24y; 0x25y; 0x26y; 0x27y; 0x28y; 0x29y; 0x2ay; 0x2by; 0x2cy; 0x2dy; 0x2ey; 0x2fy + 0x30y; 0x31y; 0x32y; 0x33y; 0x34y; 0x35y; 0x36y; 0x37y; 0x38y; 0x39y; 0x3ay; 0x3by; 0x3cy; 0x3dy; 0x3ey; 0x3fy + 0x40y; 0x41y; 0x42y; 0x43y; 0x44y; 0x45y; 0x46y; 0x47y; 0x48y; 0x49y; 0x4ay; 0x4by; 0x4cy; 0x4dy; 0x4ey; 0x4fy + 0x50y; 0x51y; 0x52y; 0x53y; 0x54y; 0x55y; 0x56y; 0x57y; 0x58y; 0x59y; 0x5ay; 0x5by; 0x5cy; 0x5dy; 0x5ey; 0x5fy + 0x60y; 0x61y; 0x62y; 0x63y; 0x64y; 0x65y; 0x66y; 0x67y; 0x68y; 0x69y; 0x6ay; 0x6by; 0x6cy; 0x6dy; 0x6ey; 0x6fy + 0x70y; 0x71y; 0x72y; 0x73y; 0x74y; 0x75y; 0x76y; 0x77y; 0x78y; 0x79y; 0x7ay; 0x7by; 0x7cy; 0x7dy; 0x7ey; 0x7fy + |] + + /// [SByte.MinValue..SByte.MaxValue] + let allSBytesList = List.ofArray allSBytesArray + + /// {SByte.MinValue..SByte.MaxValue} + let allSBytesSeq = Seq.ofArray allSBytesArray + + /// These tests' constant arguments are inlined, + /// and the size of the collection (for lists and arrays) or count (for for-loops) is computed at build-time. + module BuildTime = + [] + let ``Range.SByte`` () = + Assert.AreEqual(256, let mutable c = 0 in for _ in System.SByte.MinValue..System.SByte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in System.SByte.MinValue..1y..System.SByte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in System.SByte.MaxValue .. -1y .. System.SByte.MinValue do c <- c + 1 done; c) + + Assert.AreEqual(allSBytesSeq, {System.SByte.MinValue..System.SByte.MaxValue}) + Assert.AreEqual(allSBytesList, [System.SByte.MinValue..System.SByte.MaxValue]) + Assert.AreEqual(allSBytesArray, [|System.SByte.MinValue..System.SByte.MaxValue|]) + + Assert.AreEqual(allSBytesSeq, {System.SByte.MinValue..1y..System.SByte.MaxValue}) + Assert.AreEqual(allSBytesList, [System.SByte.MinValue..1y..System.SByte.MaxValue]) + Assert.AreEqual(allSBytesArray, [|System.SByte.MinValue..1y..System.SByte.MaxValue|]) + + Assert.AreEqual(Seq.rev allSBytesSeq, {System.SByte.MaxValue .. -1y .. System.SByte.MinValue}) + Assert.AreEqual(List.rev allSBytesList, [System.SByte.MaxValue .. -1y .. System.SByte.MinValue]) + Assert.AreEqual(Array.rev allSBytesArray, [|System.SByte.MaxValue .. -1y .. System.SByte.MinValue|]) + + RangeTestsHelpers.signed 0y 1y System.SByte.MinValue System.SByte.MaxValue + + [] + let ``Range.Byte`` () = + Assert.AreEqual(256, let mutable c = 0 in for _ in System.Byte.MinValue..System.Byte.MaxValue do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in System.Byte.MinValue..1uy..System.Byte.MaxValue do c <- c + 1 done; c) + + Assert.AreEqual(allBytesSeq, {System.Byte.MinValue..System.Byte.MaxValue}) + Assert.AreEqual(allBytesList, [System.Byte.MinValue..System.Byte.MaxValue]) + Assert.AreEqual(allBytesArray, [|System.Byte.MinValue..System.Byte.MaxValue|]) + + Assert.AreEqual(allBytesSeq, {System.Byte.MinValue..1uy..System.Byte.MaxValue}) + Assert.AreEqual(allBytesList, [System.Byte.MinValue..1uy..System.Byte.MaxValue]) + Assert.AreEqual(allBytesArray, [|System.Byte.MinValue..1uy..System.Byte.MaxValue|]) + + RangeTestsHelpers.unsigned 0uy 1uy System.Byte.MinValue System.Byte.MaxValue + + //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? + //[] + //let ``Range.Char`` () = RangeTestsHelpers.unsigned '\000' '\001' System.Char.MinValue System.Char.MaxValue + + [] + let ``Range.Int16`` () = RangeTestsHelpers.signed 0s 1s System.Int16.MinValue System.Int16.MaxValue + + [] + let ``Range.UInt16`` () = RangeTestsHelpers.unsigned 0us 1us System.UInt16.MinValue System.UInt16.MaxValue + + [] + let ``Range.Int32`` () = RangeTestsHelpers.signed 0 1 System.Int32.MinValue System.Int32.MaxValue + + [] + let ``Range.UInt32`` () = RangeTestsHelpers.unsigned 0u 1u System.UInt32.MinValue System.UInt32.MaxValue + + [] + let ``Range.Int64`` () = RangeTestsHelpers.signed 0L 1L System.Int64.MinValue System.Int64.MaxValue + + [] + let ``Range.UInt64`` () = RangeTestsHelpers.unsigned 0UL 1UL System.UInt64.MinValue System.UInt64.MaxValue + + [] + let ``Range.IntPtr`` () = + // 0x80000000n is negative on x86, but would be positive on x64. + if System.IntPtr.Size = 4 then + RangeTestsHelpers.signed 0x0n 0x1n 0x80000000n 0x7fffffffn + + if System.IntPtr.Size = 8 then + RangeTestsHelpers.signed 0x0n 0x1n 0x8000000000000000n 0x7fffffffffffffffn + + [] + let ``Range.UIntPtr`` () = + if System.UIntPtr.Size >= 4 then + RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffun + + if System.UIntPtr.Size >= 8 then + RangeTestsHelpers.unsigned 0x0un 0x1un 0x0un 0xffffffffffffffffun + + /// These tests' arguments are intentionally _not_ inlined + /// to force the size of the collection (for lists and arrays) or count (for for-loops) to be computed at runtime. + module Runtime = + [] + let ``Range.SByte`` (zero: sbyte) (one: sbyte) (min0: sbyte) (max0: sbyte) = + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..max0 do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..one..max0 do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in max0 .. -one .. min0 do c <- c + 1 done; c) + + Assert.AreEqual(allSBytesSeq, {min0..max0}) + Assert.AreEqual(allSBytesList, [min0..max0]) + Assert.AreEqual(allSBytesArray, [|min0..max0|]) + + Assert.AreEqual(allSBytesSeq, {min0..one..max0}) + Assert.AreEqual(allSBytesList, [min0..one..max0]) + Assert.AreEqual(allSBytesArray, [|min0..one..max0|]) -type RangeTests() = - [] member _.``Range.SByte`` () = RangeTestsHelpers.signed System.SByte.MinValue System.SByte.MaxValue - [] member _.``Range.Byte`` () = RangeTestsHelpers.unsigned System.Byte.MinValue System.Byte.MaxValue - [] member _.``Range.Int16`` () = RangeTestsHelpers.signed System.Int16.MinValue System.Int16.MaxValue - [] member _.``Range.UInt16`` () = RangeTestsHelpers.unsigned System.UInt16.MinValue System.UInt16.MaxValue - [] member _.``Range.Int32`` () = RangeTestsHelpers.signed System.Int32.MinValue System.Int32.MaxValue - [] member _.``Range.UInt32`` () = RangeTestsHelpers.unsigned System.UInt32.MinValue System.UInt32.MaxValue - [] member _.``Range.Int64`` () = RangeTestsHelpers.signed System.Int64.MinValue System.Int64.MaxValue - [] member _.``Range.UInt64`` () = RangeTestsHelpers.unsigned System.UInt64.MinValue System.UInt64.MaxValue + Assert.AreEqual(Seq.rev allSBytesSeq, {max0 .. -one .. min0}) + Assert.AreEqual(List.rev allSBytesList, [max0 .. -one .. min0]) + Assert.AreEqual(Array.rev allSBytesArray, [|max0 .. -one .. min0|]) + + RangeTestsHelpers.signed zero one min0 max0 + + [] + let ``Range.Byte`` (zero: byte) (one: byte) (min0: byte) (max0: byte) = + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..max0 do c <- c + 1 done; c) + Assert.AreEqual(256, let mutable c = 0 in for _ in min0..one..max0 do c <- c + 1 done; c) + + Assert.AreEqual(allBytesSeq, {min0..max0}) + Assert.AreEqual(allBytesList, [min0..max0]) + Assert.AreEqual(allBytesArray, [|min0..max0|]) - [] - member _.``Range.IntPtr`` () = - if System.IntPtr.Size >= 4 then RangeTestsHelpers.signed (System.IntPtr System.Int32.MinValue) (System.IntPtr System.Int32.MaxValue) - if System.IntPtr.Size >= 8 then RangeTestsHelpers.signed (System.IntPtr System.Int64.MinValue) (System.IntPtr System.Int64.MaxValue) - - [] - member _.``Range.UIntPtr`` () = - if System.UIntPtr.Size >= 4 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt32.MinValue) (System.UIntPtr System.UInt32.MaxValue) - if System.UIntPtr.Size >= 8 then RangeTestsHelpers.unsigned (System.UIntPtr System.UInt64.MinValue) (System.UIntPtr System.UInt64.MaxValue) - + Assert.AreEqual(allBytesSeq, {min0..one..max0}) + Assert.AreEqual(allBytesList, [min0..one..max0]) + Assert.AreEqual(allBytesArray, [|min0..one..max0|]) + + RangeTestsHelpers.unsigned zero one min0 max0 + + //// Note: the IEnumerable range iterator doesn't currently pass these tests. Should it? + //[] + //let ``Range.Char`` (zero: char) (one: char) (min0: char) (max0: char) = RangeTestsHelpers.unsigned zero one min0 max0 + + [] + let ``Range.Int16`` (zero: int16) (one: int16) (min0: int16) (max0: int16) = RangeTestsHelpers.signed zero one min0 max0 + + [] + let ``Range.UInt16`` (zero: uint16) (one: uint16) (min0: uint16) (max0: uint16) = RangeTestsHelpers.unsigned zero one min0 max0 + + [] + let ``Range.Int32`` (zero: int) (one: int) (min0: int) (max0: int) = RangeTestsHelpers.signed zero one min0 max0 + + [] + let ``Range.UInt32`` (zero: uint) (one: uint) (min0: uint) (max0: uint) = RangeTestsHelpers.unsigned zero one min0 max0 + + [] + let ``Range.Int64`` (zero: int64) (one: int64) (min0: int64) (max0: int64) = + RangeTestsHelpers.signed zero one min0 max0 + + [] + let ``Range.UInt64`` (zero: uint64) (one: uint64) (min0: uint64) (max0: uint64) = + RangeTestsHelpers.unsigned zero one min0 max0 + + [] + let ``Range.IntPtr`` () = + // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. + if System.IntPtr.Size = 4 then + let zero, one, min0, max0 = System.IntPtr 0, System.IntPtr 1, System.IntPtr System.Int32.MinValue, System.IntPtr System.Int32.MaxValue + RangeTestsHelpers.signed zero one min0 max0 + + if System.IntPtr.Size = 8 then + let zero, one, min0, max0 = System.IntPtr 0, System.IntPtr 1, System.IntPtr System.Int64.MinValue, System.IntPtr System.Int64.MaxValue + RangeTestsHelpers.signed zero one min0 max0 + + [] + let ``Range.UIntPtr`` () = + // The arguments here aren't being passed in as constants, so it doesn't matter if they're inlined. + if System.UIntPtr.Size >= 4 then + let zero, one, min0, max0 = System.UIntPtr 0u, System.UIntPtr 1u, System.UIntPtr System.UInt32.MinValue, System.UIntPtr System.UInt32.MaxValue + RangeTestsHelpers.unsigned zero one min0 max0 + + if System.UIntPtr.Size >= 8 then + let zero, one, min0, max0 = System.UIntPtr 0u, System.UIntPtr 1u, System.UIntPtr System.UInt64.MinValue, System.UIntPtr System.UInt64.MaxValue + RangeTestsHelpers.unsigned zero one min0 max0 open NonStructuralComparison diff --git a/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs b/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs index 32ca65bfe73..d5fe22cc3b3 100644 --- a/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs +++ b/tests/FSharp.Core.UnitTests/TestFrameworkHelpers.fs @@ -49,7 +49,7 @@ module private Impl = | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj - | :? seq as seq -> Enumerable.ToArray(seq) :>obj + | :? seq as seq -> seq |> Seq.toArray :> obj | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj | :? seq as seq -> seq |> Seq.toArray :>obj diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index ac97046351b..3e5488adac4 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -109,7 +109,7 @@ false - + diff --git a/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx b/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx index 59e13687105..b72489a9358 100644 --- a/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx +++ b/tests/walkthroughs/DebugStepping/TheBigFileOfDebugStepping.fsx @@ -1072,6 +1072,46 @@ module ForLoopRegularCode = printfn $"hello, x = {x}" printfn $"hello, x = {x}" + let testSimpleForEachIntRangeStepLoopWithOneStatement (start, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachIntRangeStepLoopWithTwoStatements (start, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopWithOneStatement (start: int64, stop) = + for x in start .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopWithTwoStatements (start: int64, stop) = + for x in start .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopDownWithOneStatement (start: int64, stop) = + for x in start .. -1L .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeLoopDownWithTwoStatements (start: int64, stop) = + for x in start .. -1L .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeStepLoopWithOneStatement (start: int64, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeStepLoopWithTwoStatements (start: int64, step, stop) = + for x in start .. step .. stop do + printfn $"hello, x = {x}" + printfn $"hello, x = {x}" + + let testSimpleForEachInt64RangeStepLoopWithConstCount () = + for x in 1L .. 3L .. 9L do + printfn $"hello, x = {x}" + let testSimpleForEachIntLoopWithOneStatement (start, stop) = for x = start to stop do printfn $"hello, x = {x}" @@ -1102,6 +1142,17 @@ module ForLoopRegularCode = testSimpleForEachIntRangeLoopWithTwoStatements (1, 3) testSimpleForEachIntRangeLoopDownWithOneStatement (1, 3) testSimpleForEachIntRangeLoopDownWithTwoStatements (1, 3) + + testSimpleForEachIntRangeStepLoopWithOneStatement (-1, 5, 10) + testSimpleForEachIntRangeStepLoopWithTwoStatements (-1, 5, 10) + testSimpleForEachInt64RangeLoopWithOneStatement (3L, 7L) + testSimpleForEachInt64RangeLoopWithTwoStatements (-4L, 0L) + testSimpleForEachInt64RangeLoopDownWithOneStatement (3L, -1L) + testSimpleForEachInt64RangeLoopDownWithTwoStatements (3L, -1L) + testSimpleForEachInt64RangeStepLoopWithOneStatement (0L, 2L, 5L) + testSimpleForEachInt64RangeStepLoopWithTwoStatements (0L, 2L, 5L) + testSimpleForEachInt64RangeStepLoopWithConstCount () + testSimpleForEachIntLoopWithOneStatement (1, 3) testSimpleForEachIntLoopWithTwoStatements (1, 3) testSimpleForEachIntLoopDownWithOneStatement (1, 3)