Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module Nowarn =
|| (List.zip expected actual |> List.exists(fun((error, line), d) -> error <> d.Error || line <> d.Range.StartLine))

let private withDiags testId langVersion flags (sources: SourceCodeFileKind list) (expected: (ErrorType * int) list) (result: CompilationResult) =
let actual = result.Output.Diagnostics
let actual = result.Output.Diagnostics |> List.distinctBy (fun ei -> ei.Range.StartLine, ei.Range.StartColumn, ei.Range.EndLine, ei.Range.EndColumn, ei.Message)
if testFailed expected actual then
let sb = new StringBuilder()
let print (s: string) = sb.AppendLine s |> ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ if returnvalue2<> true && value2 <> 7 then
compilation
|> getCompilation
|> ignoreWarnings
|> compile
|> verifyILBaseline

[<Fact>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ module OffsideExceptions =
|> getCompilation
|> asFsx
|> withLangVersion60
|> typecheck
|> verifyBaseline
|> ignore

[<Fact>]
let RelaxWhitespace2_Indentation() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module PrimitiveConstraints =
let ``Invalid object constructor`` compilation = // Regression test for FSharp1.0:4189
compilation
|> getCompilation
|> typecheck
|> verifyBaseline

[<Fact>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module AsyncExpressionStepping =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyBaseline
|> verifyILBaseline

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module AttributeTargets =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyBaseline
|> verifyILBaseline

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ module CCtorDUWithMember =
let verifyCompilation compilation =
compilation
|> withOptions [ "--test:EmitFeeFeeAs100001" ]
|> withNoWarn 988
|> asExe
|> withNoOptimize
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyBaseline
|> verifyILBaseline

Expand Down Expand Up @@ -71,7 +73,7 @@ type ILArrayShape =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
"""
.method public hidebysig instance bool
Equals(class RealInternalSignature.ILArrayShape obj,
Expand All @@ -97,7 +99,7 @@ type ILArrayShape =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
"""
.method public hidebysig instance bool
Equals(class RealInternalSignature.ILArrayShape obj,
Expand Down Expand Up @@ -125,7 +127,7 @@ Module.publicFunction () |> printfn "%b"
|> asExe
|> withRealInternalSignature realSig
|> compileAndRun
|> withILContains [
|> verifyILContains [
$$"""
.method {{expected}} hidebysig instance bool Equals(class RealInternalSignature/Module/DU obj, class [runtime]System.Collections.IEqualityComparer comp) cil managed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ module CompiledNameAttribute =
compilation
|> asFs
|> withOptions [ "--test:EmitFeeFeeAs100001" ]
|> withNoWarn 988
|> asExe
|> withNoOptimize
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyBaseline
|> verifyILBaseline

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module ComputationExpressions =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> typecheck
|> verifyILBaseline

[<Theory; FileInlineData("ComputationExpr01.fs", Realsig=BooleanOptions.Both)>]
Expand Down Expand Up @@ -85,4 +86,5 @@ module ComputationExpressions =
]
|> withEmbeddedPdb
|> withEmbedAllSource
|> typecheck
|> verifyILBaseline
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ module ComputedCollections =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

[<Theory; FileInlineData("Int32RangeArrays.fs", Realsig = BooleanOptions.Both, Optimize = BooleanOptions.True)>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module DoNotBoxStruct =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

//SOURCE=DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.exe" # DoNotBoxStruct_ArrayOfArray_FSInterface_NoExtMeth.fs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@ module ForLoop =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline
|> verifyPEFileWithSystemDlls
|> withOutputContainsAllInOrderWithWildcards [
"All Classes and Methods in*.exe Verified."
]

// SOURCE=ForLoop01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ForLoop01.exe" # ForLoop01.fs -
[<Theory; FileInlineData("ForLoop01.fs", Realsig=BooleanOptions.Both, Optimize=BooleanOptions.False)>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module GeneratedIterators =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

// SOURCE=GenIter01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd GenIter01.exe" # GenIter01.fs -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module GenericComparison =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

// SOURCE=Compare01.fsx SCFLAGS="-a -g --optimize+" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Compare01.dll" # Compare01.fs -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module InequalityComparison =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

// SOURCE=InequalityComparison01.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd InequalityComparison01.exe" # x <= y
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module Inlining =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

let withRealInternalSignature realSig compilation =
Expand Down Expand Up @@ -50,6 +51,7 @@ module Inlining =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

[<Fact>]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module ListExpressionStepping =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

// SOURCE=ListExpressionSteppingTest1.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd ListExpressionSteppingTest1.exe" # ListExpressionSteppingTest1.fs -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module MethodImplAttribute =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

// SOURCE=MethodImplAttribute.ForwardRef.fs SCFLAGS="-a -g --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd MethodImplAttribute.ForwardRef.dll" # MethodImplAttribute.ForwardRef.fs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ module Misc =
|> withEmbeddedPdb
|> withEmbedAllSource
|> ignoreWarnings
|> compile
|> verifyILBaseline

// SOURCE=AbstractClass.fs SCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd AbstractClass.exe" # AbstractClass.fs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ module NullnessMetadata =

let verifyCompilation (o:Optimize) compilation =
compilation
|> addOptions o
|> addOptions o
|> compile
|> verifyILBaseline

[<Theory; FileInlineData("ModuleLevelBindings.fs")>]
Expand Down Expand Up @@ -134,7 +135,7 @@ module NullnessMetadata =
|> withNoWarn 52
|> addOptions DoNotOptimize
|> compile
|> withILContains
|> verifyILContains
[".method public hidebysig virtual instance string ToString() cil managed"
".method public hidebysig virtual instance int32 GetHashCode() cil managed"
"hidebysig virtual instance bool Equals(object obj) cil managed"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module QueryExpressionStepping =
|> withEmbedAllSource
|> withReferences [utilsLibrary]
|> ignoreWarnings
|> typecheck
|> verifyILBaseline

// SOURCE=Linq101Aggregates01.fs SCFLAGS="-r:Utils.dll -g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Linq101Aggregates01.exe" # Linq101Aggregates01.fs - CodeGen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type public TypeFour () = class end
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
""" .class auto ansi serializable nested public TypeOne
extends [runtime]System.Object
{
Expand Down Expand Up @@ -74,7 +74,7 @@ type private TypeFour () = class end
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
//type private TypeOne public () = class end
""".class auto ansi serializable nested private TypeOne
Expand Down Expand Up @@ -161,7 +161,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig instance void
Expand Down Expand Up @@ -250,7 +250,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig instance void
Expand Down Expand Up @@ -339,7 +339,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig specialname
Expand Down Expand Up @@ -564,7 +564,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig specialname
Expand Down Expand Up @@ -797,7 +797,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig specialname
Expand Down Expand Up @@ -1238,7 +1238,7 @@ type private TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method assembly hidebysig specialname
Expand Down Expand Up @@ -1671,7 +1671,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig instance void
Expand Down Expand Up @@ -1760,7 +1760,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig instance void
Expand Down Expand Up @@ -1848,7 +1848,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.me thod public specialname static int32
Expand Down Expand Up @@ -2184,7 +2184,7 @@ type private TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig specialname
Expand Down Expand Up @@ -2417,7 +2417,7 @@ type public TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method public hidebysig specialname
Expand Down Expand Up @@ -2858,7 +2858,7 @@ type private TestType () =
|> asLibrary
|> withRealInternalSignature realSig
|> compile
|> withILContains [
|> verifyILContains [
if realSig then
"""
.method assembly hidebysig specialname
Expand Down
Loading
Loading