From 3a38b7ae87d78ededd2888adfb63680aea61ecc8 Mon Sep 17 00:00:00 2001 From: desco Date: Thu, 23 Oct 2014 14:44:07 -0700 Subject: [PATCH] Fix cross module inlining commit 8f1dcd1c760ce7ab2ae9de706bf12763038f2257 Author: latkin Date: Thu Oct 23 14:43:21 2014 -0700 Updating tests to use proper env variables, adding .gitignore, renaming .cmd to .bat commit 6097fc2b506c7b61130cf87643ba09f3740e05d5 Merge: 94c895d 0fc7b47 Author: latkin Date: Thu Oct 23 14:09:37 2014 -0700 Merge branch 'pcl_inlining' of https://git01.codeplex.com/forks/vladima/primary into crossmodule commit 0fc7b4707146d0cf198af1863dcc307d017ede45 Author: desco Date: Wed Oct 8 10:30:58 2014 -0700 remove PrimaryAssembly.NamedMscorlib commit b84ff88dce143bfd746e214acd806a839aa2903a Author: desco Date: Sat Oct 4 14:13:44 2014 -0700 added test to list commit ee32d77d825cf57202135eb40eff9269aaa20c31 Author: desco Date: Fri Oct 3 23:24:30 2014 -0700 Added tests commit 7f0a59be92f544e4d04c5e41db1679490c419b3a Author: desco Date: Fri Oct 3 16:27:13 2014 -0700 consider both mscorlib and System.Runtime as candidate names of primary assembly --- src/absil/il.fs | 63 ++++++++++-------- src/absil/il.fsi | 41 +++++++----- src/absil/ilwrite.fs | 35 +++++----- src/fsharp/build.fs | 96 ++++++++++++--------------- src/fsharp/build.fsi | 6 -- src/fsharp/fscopts.fs | 1 - tests/fsharp/core/interop/.gitignore | 7 ++ tests/fsharp/core/interop/PCL.fs | 8 +++ tests/fsharp/core/interop/PCL.fsproj | 39 +++++++++++ tests/fsharp/core/interop/User.fs | 11 +++ tests/fsharp/core/interop/User.fsproj | 43 ++++++++++++ tests/fsharp/core/interop/build.bat | 26 ++++++++ tests/fsharp/core/interop/run.bat | 2 + tests/test.lst | 1 + 14 files changed, 256 insertions(+), 123 deletions(-) create mode 100644 tests/fsharp/core/interop/.gitignore create mode 100644 tests/fsharp/core/interop/PCL.fs create mode 100644 tests/fsharp/core/interop/PCL.fsproj create mode 100644 tests/fsharp/core/interop/User.fs create mode 100644 tests/fsharp/core/interop/User.fsproj create mode 100644 tests/fsharp/core/interop/build.bat create mode 100644 tests/fsharp/core/interop/run.bat diff --git a/src/absil/il.fs b/src/absil/il.fs index a41aa2648..8df4f7403 100644 --- a/src/absil/il.fs +++ b/src/absil/il.fs @@ -45,6 +45,15 @@ let notlazy v = Lazy.CreateFromValue v let lazyMap f (x:Lazy<_>) = if x.IsValueCreated then notlazy (f (x.Force())) else lazy (f (x.Force())) +type PrimaryAssembly = + | Mscorlib + | DotNetCore + + member this.Name = + match this with + | Mscorlib -> "mscorlib" + | DotNetCore -> "System.Runtime" + // -------------------------------------------------------------------- // Utilities: type names // -------------------------------------------------------------------- @@ -2847,41 +2856,43 @@ let typ_is_boxed = function ILType.Boxed _ -> true | _ -> false let typ_is_value = function ILType.Value _ -> true | _ -> false -let tspec_is_primaryAssembly ilg (tspec:ILTypeSpec) n = +let tspec_is_primaryAssembly (tspec:ILTypeSpec) n = let tref = tspec.TypeRef let scoref = tref.Scope (tref.Name = n) && match scoref with - | ILScopeRef.Assembly n -> n.Name = ilg.primaryAssemblyName + | ILScopeRef.Assembly n -> + n.Name = PrimaryAssembly.Mscorlib.Name || + n.Name = PrimaryAssembly.DotNetCore.Name | ILScopeRef.Module _ -> false | ILScopeRef.Local -> true -let typ_is_boxed_mscorlib_typ ilg (ty:ILType) n = - typ_is_boxed ty && tspec_is_primaryAssembly ilg ty.TypeSpec n +let typ_is_boxed_mscorlib_typ (ty:ILType) n = + typ_is_boxed ty && tspec_is_primaryAssembly ty.TypeSpec n -let typ_is_value_mscorlib_typ ilg (ty:ILType) n = - typ_is_value ty && tspec_is_primaryAssembly ilg ty.TypeSpec n +let typ_is_value_mscorlib_typ (ty:ILType) n = + typ_is_value ty && tspec_is_primaryAssembly ty.TypeSpec n -let isILObjectTy ilg ty = typ_is_boxed_mscorlib_typ ilg ty tname_Object -let isILStringTy ilg ty = typ_is_boxed_mscorlib_typ ilg ty tname_String -let typ_is_AsyncCallback ilg ty = typ_is_boxed_mscorlib_typ ilg ty tname_AsyncCallback -let isILTypedReferenceTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_TypedReference -let typ_is_IAsyncResult ilg ty = typ_is_boxed_mscorlib_typ ilg ty tname_IAsyncResult -let typ_is_IComparable ilg ty = typ_is_boxed_mscorlib_typ ilg ty tname_IComparable -let isILSByteTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_SByte -let isILByteTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Byte -let isILInt16Ty ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Int16 -let isILUInt16Ty ilg ty = typ_is_value_mscorlib_typ ilg ty tname_UInt16 -let isILInt32Ty ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Int32 -let isILUInt32Ty ilg ty = typ_is_value_mscorlib_typ ilg ty tname_UInt32 -let isILInt64Ty ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Int64 -let isILUInt64Ty ilg ty = typ_is_value_mscorlib_typ ilg ty tname_UInt64 -let isILIntPtrTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_IntPtr -let isILUIntPtrTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_UIntPtr -let isILBoolTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Bool -let isILCharTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Char -let isILSingleTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Single -let isILDoubleTy ilg ty = typ_is_value_mscorlib_typ ilg ty tname_Double +let isILObjectTy ty = typ_is_boxed_mscorlib_typ ty tname_Object +let isILStringTy ty = typ_is_boxed_mscorlib_typ ty tname_String +let typ_is_AsyncCallback ty = typ_is_boxed_mscorlib_typ ty tname_AsyncCallback +let isILTypedReferenceTy ty = typ_is_value_mscorlib_typ ty tname_TypedReference +let typ_is_IAsyncResult ty = typ_is_boxed_mscorlib_typ ty tname_IAsyncResult +let typ_is_IComparable ty = typ_is_boxed_mscorlib_typ ty tname_IComparable +let isILSByteTy ty = typ_is_value_mscorlib_typ ty tname_SByte +let isILByteTy ty = typ_is_value_mscorlib_typ ty tname_Byte +let isILInt16Ty ty = typ_is_value_mscorlib_typ ty tname_Int16 +let isILUInt16Ty ty = typ_is_value_mscorlib_typ ty tname_UInt16 +let isILInt32Ty ty = typ_is_value_mscorlib_typ ty tname_Int32 +let isILUInt32Ty ty = typ_is_value_mscorlib_typ ty tname_UInt32 +let isILInt64Ty ty = typ_is_value_mscorlib_typ ty tname_Int64 +let isILUInt64Ty ty = typ_is_value_mscorlib_typ ty tname_UInt64 +let isILIntPtrTy ty = typ_is_value_mscorlib_typ ty tname_IntPtr +let isILUIntPtrTy ty = typ_is_value_mscorlib_typ ty tname_UIntPtr +let isILBoolTy ty = typ_is_value_mscorlib_typ ty tname_Bool +let isILCharTy ty = typ_is_value_mscorlib_typ ty tname_Char +let isILSingleTy ty = typ_is_value_mscorlib_typ ty tname_Single +let isILDoubleTy ty = typ_is_value_mscorlib_typ ty tname_Double // -------------------------------------------------------------------- // Rescoping diff --git a/src/absil/il.fsi b/src/absil/il.fsi index 63895ca6c..c141a6267 100644 --- a/src/absil/il.fsi +++ b/src/absil/il.fsi @@ -20,7 +20,12 @@ type ILList<'T> = ThreeList<'T> //#if ABSIL_USES_LIST_FOR_ILLIST type ILList<'T> = 'T list //#endif - + +type PrimaryAssembly = + | Mscorlib + | DotNetCore + + member Name: string // ==================================================================== // .NET binaries can be converted to the data structures below by using @@ -2212,23 +2217,23 @@ val addPropertyNeverAttrs : ILGlobals -> ILPropertyDef -> ILPropertyDef val addFieldNeverAttrs : ILGlobals -> ILFieldDef -> ILFieldDef /// Discriminating different important built-in types -val isILObjectTy: ILGlobals -> ILType -> bool -val isILStringTy: ILGlobals -> ILType -> bool -val isILSByteTy: ILGlobals -> ILType -> bool -val isILByteTy: ILGlobals -> ILType -> bool -val isILInt16Ty: ILGlobals -> ILType -> bool -val isILUInt16Ty: ILGlobals -> ILType -> bool -val isILInt32Ty: ILGlobals -> ILType -> bool -val isILUInt32Ty: ILGlobals -> ILType -> bool -val isILInt64Ty: ILGlobals -> ILType -> bool -val isILUInt64Ty: ILGlobals -> ILType -> bool -val isILIntPtrTy: ILGlobals -> ILType -> bool -val isILUIntPtrTy: ILGlobals -> ILType -> bool -val isILBoolTy: ILGlobals -> ILType -> bool -val isILCharTy: ILGlobals -> ILType -> bool -val isILTypedReferenceTy: ILGlobals -> ILType -> bool -val isILDoubleTy: ILGlobals -> ILType -> bool -val isILSingleTy: ILGlobals -> ILType -> bool +val isILObjectTy: ILType -> bool +val isILStringTy: ILType -> bool +val isILSByteTy: ILType -> bool +val isILByteTy: ILType -> bool +val isILInt16Ty: ILType -> bool +val isILUInt16Ty: ILType -> bool +val isILInt32Ty: ILType -> bool +val isILUInt32Ty: ILType -> bool +val isILInt64Ty: ILType -> bool +val isILUInt64Ty: ILType -> bool +val isILIntPtrTy: ILType -> bool +val isILUIntPtrTy: ILType -> bool +val isILBoolTy: ILType -> bool +val isILCharTy: ILType -> bool +val isILTypedReferenceTy: ILType -> bool +val isILDoubleTy: ILType -> bool +val isILSingleTy: ILType -> bool /// Get a public key token from a public key. val sha1HashBytes : byte[] -> byte[] (* SHA1 hash *) diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs index 11d79313d..1ea6925fb 100644 --- a/src/absil/ilwrite.fs +++ b/src/absil/ilwrite.fs @@ -1188,28 +1188,27 @@ and GetTypeAsTypeSpecIdx cenv env ty = FindOrAddRow cenv TableNames.TypeSpec (GetTypeAsTypeSpecRow cenv env ty) and EmitType cenv env bb ty = - let ilg = cenv.ilg match ty with // REVIEW: what are these doing here? | ILType.Value tspec when tspec.Name = "System.String" -> bb.EmitByte et_STRING | ILType.Value tspec when tspec.Name = "System.Object" -> bb.EmitByte et_OBJECT - | typ when isILSByteTy ilg typ -> bb.EmitByte et_I1 - | typ when isILInt16Ty ilg typ -> bb.EmitByte et_I2 - | typ when isILInt32Ty ilg typ -> bb.EmitByte et_I4 - | typ when isILInt64Ty ilg typ -> bb.EmitByte et_I8 - | typ when isILByteTy ilg typ -> bb.EmitByte et_U1 - | typ when isILUInt16Ty ilg typ -> bb.EmitByte et_U2 - | typ when isILUInt32Ty ilg typ -> bb.EmitByte et_U4 - | typ when isILUInt64Ty ilg typ -> bb.EmitByte et_U8 - | typ when isILDoubleTy ilg typ -> bb.EmitByte et_R8 - | typ when isILSingleTy ilg typ -> bb.EmitByte et_R4 - | typ when isILBoolTy ilg typ -> bb.EmitByte et_BOOLEAN - | typ when isILCharTy ilg typ -> bb.EmitByte et_CHAR - | typ when isILStringTy ilg typ -> bb.EmitByte et_STRING - | typ when isILObjectTy ilg typ -> bb.EmitByte et_OBJECT - | typ when isILIntPtrTy ilg typ -> bb.EmitByte et_I - | typ when isILUIntPtrTy ilg typ -> bb.EmitByte et_U - | typ when isILTypedReferenceTy ilg typ -> bb.EmitByte et_TYPEDBYREF + | typ when isILSByteTy typ -> bb.EmitByte et_I1 + | typ when isILInt16Ty typ -> bb.EmitByte et_I2 + | typ when isILInt32Ty typ -> bb.EmitByte et_I4 + | typ when isILInt64Ty typ -> bb.EmitByte et_I8 + | typ when isILByteTy typ -> bb.EmitByte et_U1 + | typ when isILUInt16Ty typ -> bb.EmitByte et_U2 + | typ when isILUInt32Ty typ -> bb.EmitByte et_U4 + | typ when isILUInt64Ty typ -> bb.EmitByte et_U8 + | typ when isILDoubleTy typ -> bb.EmitByte et_R8 + | typ when isILSingleTy typ -> bb.EmitByte et_R4 + | typ when isILBoolTy typ -> bb.EmitByte et_BOOLEAN + | typ when isILCharTy typ -> bb.EmitByte et_CHAR + | typ when isILStringTy typ -> bb.EmitByte et_STRING + | typ when isILObjectTy typ -> bb.EmitByte et_OBJECT + | typ when isILIntPtrTy typ -> bb.EmitByte et_I + | typ when isILUIntPtrTy typ -> bb.EmitByte et_U + | typ when isILTypedReferenceTy typ -> bb.EmitByte et_TYPEDBYREF | ILType.Boxed tspec -> EmitTypeSpec cenv env bb (et_CLASS,tspec) | ILType.Value tspec -> EmitTypeSpec cenv env bb (et_VALUETYPE,tspec) diff --git a/src/fsharp/build.fs b/src/fsharp/build.fs index d97a00117..2b02ce639 100644 --- a/src/fsharp/build.fs +++ b/src/fsharp/build.fs @@ -1802,59 +1802,47 @@ type NetCoreSystemRuntimeTraits(primaryAssembly) = member this.MarshalByRefObjectScopeRef = None member this.ArgIteratorTypeScopeRef = None -type PrimaryAssembly = - | Mscorlib - | NamedMscorlib of string - | DotNetCore - - member this.Name = - match this with - | Mscorlib -> "mscorlib" - | DotNetCore -> "System.Runtime" - | NamedMscorlib name -> name - - member this.GetSystemRuntimeInitializer(mkReference : string -> AssemblyReference) : ISystemRuntimeCcuInitializer = - let name = this.Name - let primaryAssemblyReference = mkReference name - - match this with - | Mscorlib - | NamedMscorlib _-> - { - new ISystemRuntimeCcuInitializer with - member this.BeginLoadingSystemRuntime(resolver, noData) = - let mscorlibRef = resolver primaryAssemblyReference - let traits = (IL.mkMscorlibBasedTraits mscorlibRef.FSharpViewOfMetadata.ILScopeRef) - (mkILGlobals traits (Some name) noData), box mscorlibRef - member this.EndLoadingSystemRuntime(state, _resolver) = - unbox state - } - - | DotNetCore -> - let systemReflectionRef = mkReference "System.Reflection" - let systemDiagnosticsDebugRef = mkReference "System.Diagnostics.Debug" - let systemLinqExpressionsRef = mkReference "System.Linq.Expressions" - let systemCollectionsRef = mkReference "System.Collections" - let systemRuntimeInteropServicesRef = mkReference "System.Runtime.InteropServices" - { - new ISystemRuntimeCcuInitializer with - member this.BeginLoadingSystemRuntime(resolver, noData) = - let primaryAssembly = resolver primaryAssemblyReference - let traits = new NetCoreSystemRuntimeTraits(primaryAssembly.FSharpViewOfMetadata.ILScopeRef) - mkILGlobals traits (Some name) noData, box (primaryAssembly, traits) - member this.EndLoadingSystemRuntime(state, resolver) = - let (primaryAssembly : ImportedAssembly, traits : NetCoreSystemRuntimeTraits) = unbox state - // finish initialization of SystemRuntimeTraits - traits.FixupImportedAssemblies - ( - systemReflectionRef = resolver CcuLoadFailureAction.RaiseError systemReflectionRef, - systemDiagnosticsDebugRef = resolver CcuLoadFailureAction.RaiseError systemDiagnosticsDebugRef, - systemRuntimeInteropServicesRef = resolver CcuLoadFailureAction.ReturnNone systemRuntimeInteropServicesRef, - systemLinqExpressionsRef = resolver CcuLoadFailureAction.RaiseError systemLinqExpressionsRef, - systemCollectionsRef = resolver CcuLoadFailureAction.RaiseError systemCollectionsRef - ) - primaryAssembly - } +let getSystemRuntimeInitializer (primaryAssembly: PrimaryAssembly) (mkReference : string -> AssemblyReference) : ISystemRuntimeCcuInitializer = + let name = primaryAssembly.Name + let primaryAssemblyReference = mkReference name + + match primaryAssembly with + | Mscorlib -> + { + new ISystemRuntimeCcuInitializer with + member this.BeginLoadingSystemRuntime(resolver, noData) = + let mscorlibRef = resolver primaryAssemblyReference + let traits = (IL.mkMscorlibBasedTraits mscorlibRef.FSharpViewOfMetadata.ILScopeRef) + (mkILGlobals traits (Some name) noData), box mscorlibRef + member this.EndLoadingSystemRuntime(state, _resolver) = + unbox state + } + + | DotNetCore -> + let systemReflectionRef = mkReference "System.Reflection" + let systemDiagnosticsDebugRef = mkReference "System.Diagnostics.Debug" + let systemLinqExpressionsRef = mkReference "System.Linq.Expressions" + let systemCollectionsRef = mkReference "System.Collections" + let systemRuntimeInteropServicesRef = mkReference "System.Runtime.InteropServices" + { + new ISystemRuntimeCcuInitializer with + member this.BeginLoadingSystemRuntime(resolver, noData) = + let primaryAssembly = resolver primaryAssemblyReference + let traits = new NetCoreSystemRuntimeTraits(primaryAssembly.FSharpViewOfMetadata.ILScopeRef) + mkILGlobals traits (Some name) noData, box (primaryAssembly, traits) + member this.EndLoadingSystemRuntime(state, resolver) = + let (primaryAssembly : ImportedAssembly, traits : NetCoreSystemRuntimeTraits) = unbox state + // finish initialization of SystemRuntimeTraits + traits.FixupImportedAssemblies + ( + systemReflectionRef = resolver CcuLoadFailureAction.RaiseError systemReflectionRef, + systemDiagnosticsDebugRef = resolver CcuLoadFailureAction.RaiseError systemDiagnosticsDebugRef, + systemRuntimeInteropServicesRef = resolver CcuLoadFailureAction.ReturnNone systemRuntimeInteropServicesRef, + systemLinqExpressionsRef = resolver CcuLoadFailureAction.RaiseError systemLinqExpressionsRef, + systemCollectionsRef = resolver CcuLoadFailureAction.RaiseError systemCollectionsRef + ) + primaryAssembly + } type TcConfigBuilder = @@ -2400,7 +2388,7 @@ type TcConfig private (data : TcConfigBuilder,validate:bool) = // if FSharp.Core was not provided explicitly - use version that was referenced by compiler AssemblyReference(range0, GetFSharpCoreReferenceUsedByCompiler()), None | _ -> res - let primaryAssemblyCcuInitializer = data.primaryAssembly.GetSystemRuntimeInitializer(computeKnownDllReference >> fst) + let primaryAssemblyCcuInitializer = getSystemRuntimeInitializer data.primaryAssembly (computeKnownDllReference >> fst) // If either mscorlib.dll/System.Runtime.dll or fsharp.core.dll are explicitly specified then we require the --noframework flag. // The reason is that some non-default frameworks may not have the default dlls. For example, Client profile does diff --git a/src/fsharp/build.fsi b/src/fsharp/build.fsi index 8304f40c1..cbdfe10e5 100644 --- a/src/fsharp/build.fsi +++ b/src/fsharp/build.fsi @@ -155,12 +155,6 @@ exception InternalCommandLineOption of string * range exception HashLoadedSourceHasIssues of (*warnings*) exn list * (*errors*) exn list * range exception HashLoadedScriptConsideredSource of range -type PrimaryAssembly = - | Mscorlib - | NamedMscorlib of string - | DotNetCore - member Name : string - type AssemblyReference = | AssemblyReference of range * string member Range : range diff --git a/src/fsharp/fscopts.fs b/src/fsharp/fscopts.fs index b7cc4d503..b2e11765e 100644 --- a/src/fsharp/fscopts.fs +++ b/src/fsharp/fscopts.fs @@ -474,7 +474,6 @@ let internalFlags (tcConfigB:TcConfigBuilder) = CompilerOption("simulateException", tagNone, OptionString (fun s -> tcConfigB.simulateException <- Some(s)), Some(InternalCommandLineOption("--simulateException", rangeCmdArgs)), Some "Simulate an exception from some part of the compiler"); CompilerOption("stackReserveSize", tagNone, OptionString (fun s -> tcConfigB.stackReserveSize <- Some(int32 s)), Some(InternalCommandLineOption("--stackReserveSize", rangeCmdArgs)), Some ("for an exe, set stack reserve size")); CompilerOption("tlr", tagInt, OptionInt (setFlag (fun v -> tcConfigB.doTLR <- v)), Some(InternalCommandLineOption("--tlr", rangeCmdArgs)), None); - CompilerOption("mscorlibAssemblyName", tagNone, OptionString (fun s -> tcConfigB.primaryAssembly <- PrimaryAssembly.NamedMscorlib s ), None, None); CompilerOption("finalSimplify", tagInt, OptionInt (setFlag (fun v -> tcConfigB.doFinalSimplify <- v)), Some(InternalCommandLineOption("--finalSimplify", rangeCmdArgs)), None); #if TLR_LIFT CompilerOption("tlrlift", tagNone, OptionInt (setFlag (fun v -> Tlr.liftTLR := v)), Some(InternalCommandLineOption("--tlrlift", rangeCmdArgs)), None); diff --git a/tests/fsharp/core/interop/.gitignore b/tests/fsharp/core/interop/.gitignore new file mode 100644 index 000000000..7482a3588 --- /dev/null +++ b/tests/fsharp/core/interop/.gitignore @@ -0,0 +1,7 @@ +FSharp.Core.* +PCL.dll +PCL.pdb +User.exe +User.exe.config +User.pdb +build.ok \ No newline at end of file diff --git a/tests/fsharp/core/interop/PCL.fs b/tests/fsharp/core/interop/PCL.fs new file mode 100644 index 000000000..d16ed9f71 --- /dev/null +++ b/tests/fsharp/core/interop/PCL.fs @@ -0,0 +1,8 @@ +namespace PCL + +open System + +module Lib = + + let year (dt: DateTime) = + dt.Year diff --git a/tests/fsharp/core/interop/PCL.fsproj b/tests/fsharp/core/interop/PCL.fsproj new file mode 100644 index 000000000..7e751cf63 --- /dev/null +++ b/tests/fsharp/core/interop/PCL.fsproj @@ -0,0 +1,39 @@ + + + + + Release + AnyCPU + 2.0 + a5726914-661b-4f63-afe5-c6a07df2e33a + Library + PCL + PCL + v4.5 + Profile78 + netcore + PCL + $(FSCBINPATH) + + + pdbonly + true + true + . + TRACE + 3 + + + 12 + + + + + + + + FSharp.Core + $(FSCOREDLLNETCORE78PATH) + + + diff --git a/tests/fsharp/core/interop/User.fs b/tests/fsharp/core/interop/User.fs new file mode 100644 index 000000000..b6675a873 --- /dev/null +++ b/tests/fsharp/core/interop/User.fs @@ -0,0 +1,11 @@ +namespace User + +open System + +module Main = + + [] + let start args = + let _ = PCL.Lib.year DateTime.Now + printfn "OK" + 0 diff --git a/tests/fsharp/core/interop/User.fsproj b/tests/fsharp/core/interop/User.fsproj new file mode 100644 index 000000000..4f4f465e0 --- /dev/null +++ b/tests/fsharp/core/interop/User.fsproj @@ -0,0 +1,43 @@ + + + + + Release + AnyCPU + 2.0 + 70052dc8-ceb0-4460-ad5d-60bb8d01126f + Exe + true + true + User + User + v4.5 + User + $(FSCBINPATH) + + + pdbonly + true + true + . + TRACE + 3 + + + 11 + + + $(FSCBINPATH)\Microsoft.FSharp.Targets + + + + + True + $(FSCOREDLLPATH) + + + + + + + diff --git a/tests/fsharp/core/interop/build.bat b/tests/fsharp/core/interop/build.bat new file mode 100644 index 000000000..c36286c7e --- /dev/null +++ b/tests/fsharp/core/interop/build.bat @@ -0,0 +1,26 @@ +@if "%_echo%"=="" echo off + +setlocal + +if EXIST build.ok DEL /f /q build.ok +rd /S /Q obj +del /f /q *.pdb *.xml *.config *.dll *.exe +call %~d0%~p0..\..\..\config.bat + +"%MSBUILDTOOLSPATH%\msbuild.exe" PCL.fsproj +@if ERRORLEVEL 1 goto Error +"%MSBUILDTOOLSPATH%\msbuild.exe" User.fsproj +@if ERRORLEVEL 1 goto Error + +%PEVERIFY% User.exe +@if ERRORLEVEL 1 goto Error + +:Ok +echo Built fsharp %~f0 ok. +echo. > build.ok +endlocal +exit /b 0 + +:Error +endlocal +exit /b %ERRORLEVEL% diff --git a/tests/fsharp/core/interop/run.bat b/tests/fsharp/core/interop/run.bat new file mode 100644 index 000000000..d812b5fda --- /dev/null +++ b/tests/fsharp/core/interop/run.bat @@ -0,0 +1,2 @@ +User.exe +exit /b 0 \ No newline at end of file diff --git a/tests/test.lst b/tests/test.lst index fa6a4f928..f85bb1c2d 100644 --- a/tests/test.lst +++ b/tests/test.lst @@ -33,6 +33,7 @@ Core02 fsharp\core\hiding Core03 fsharp\core\innerpoly Core03 fsharp\core\int32 Core03 fsharp\core\internalsvisible +Core03 fsharp\core\interop Core03 fsharp\core\lazy Core03 fsharp\core\letrec Core03 fsharp\core\libtest -- GitLab