-
Notifications
You must be signed in to change notification settings - Fork 830
Move a few moar tests from fsharpqa to fsharp.compiler.componenttests #15237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
afc37c2
e71e8e4
3cbe2ff
9892ac9
c7d8f5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
|
||
| namespace FSharp.Compiler.ComponentTests.CompilerOptions | ||
|
|
||
| open System | ||
|
|
||
| open Xunit | ||
| open FSharp.Test.Compiler | ||
|
|
||
|
|
||
| //# Sanity check - simply check that the option is valid | ||
| module crossoptimize = | ||
|
|
||
| // SOURCE=crossoptimize.fs SCFLAGS="--crossoptimize" | ||
| [<InlineData("--crossoptimize")>] | ||
| [<InlineData("--crossoptimize+")>] | ||
| [<InlineData("--crossoptimize-")>] | ||
| [<Theory>] | ||
| let ``crossoptimize_flag_fs`` option = | ||
| Fs """printfn "Hello, World!!!" """ | ||
| |> asExe | ||
| |> withOptions (if String.IsNullOrWhiteSpace option then [] else [option]) | ||
| |> compile | ||
| |> shouldSucceed | ||
|
|
||
| [<InlineData("--crossoptimize")>] | ||
| [<InlineData("--crossoptimize+")>] | ||
| [<InlineData("--crossoptimize-")>] | ||
| [<Theory>] | ||
| let ``crossoptimize_flag_fsx`` option = | ||
| Fsx """printfn "Hello, World!!!" """ | ||
| |> asExe | ||
| |> withOptions (if String.IsNullOrWhiteSpace option then [] else [option]) | ||
| |> compile | ||
| |> shouldSucceed | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| // Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. | ||
|
|
||
| namespace FSharp.Compiler.ComponentTests.CompilerOptions | ||
|
|
||
| open System | ||
| open System.Reflection.PortableExecutable | ||
|
|
||
| open Xunit | ||
| open FSharp.Test.Compiler | ||
|
|
||
|
|
||
| module highentropyva = | ||
|
|
||
| let shouldHaveFlag (expected: DllCharacteristics) (result: DllCharacteristics) = | ||
| if not (result.HasFlag expected) then | ||
| raise (new Exception $"CoffHeader.Characteristics does not contain expected flag:\nFound: {result}\n Expected: {expected}") | ||
|
|
||
| let shouldNotHaveFlag (notexpected: DllCharacteristics) (result: DllCharacteristics) = | ||
| if result.HasFlag notexpected then | ||
| raise (new Exception $"DllCharacteristics contains the unexpected flag:\nFound: {result}\nNot expected: {notexpected}") | ||
|
|
||
| [<InlineData(ExecutionPlatform.X64, null)>] | ||
| [<InlineData(ExecutionPlatform.X86, null)>] | ||
| [<InlineData(ExecutionPlatform.Arm64, null)>] | ||
| [<InlineData(ExecutionPlatform.Arm, null)>] | ||
| [<InlineData(ExecutionPlatform.X64, "--highentropyva-")>] | ||
| [<InlineData(ExecutionPlatform.X86, "--highentropyva-")>] | ||
| [<InlineData(ExecutionPlatform.Arm64, "--highentropyva-")>] | ||
| [<InlineData(ExecutionPlatform.Arm, "--highentropyva-")>] | ||
| [<Theory>] | ||
| let shouldNotGenerateHighEntropyVirtualAddressSpace platform option = | ||
| Fs """printfn "Hello, World!!!" """ | ||
| |> asExe | ||
| |> withPlatform platform | ||
| |> withOptions (if String.IsNullOrWhiteSpace option then [] else [option]) | ||
| |> compile | ||
| |> shouldSucceed | ||
| |> withPeReader(fun rdr -> rdr.PEHeaders.PEHeader.DllCharacteristics) | ||
| |> shouldNotHaveFlag DllCharacteristics.HighEntropyVirtualAddressSpace | ||
|
|
||
| [<InlineData(ExecutionPlatform.X64, "--highentropyva")>] | ||
| [<InlineData(ExecutionPlatform.X64, "--highentropyva+")>] | ||
| [<InlineData(ExecutionPlatform.X86, "--highentropyva")>] | ||
| [<InlineData(ExecutionPlatform.X86, "--highentropyva+")>] | ||
| [<InlineData(ExecutionPlatform.Arm64, "--highentropyva+")>] | ||
| [<InlineData(ExecutionPlatform.Arm64, "--highentropyva")>] | ||
| [<InlineData(ExecutionPlatform.Arm, "--highentropyva")>] | ||
| [<InlineData(ExecutionPlatform.Arm, "--highentropyva+")>] | ||
| [<Theory>] | ||
| let shouldGenerateHighEntropyVirtualAddressSpace platform option = | ||
| Fs """printfn "Hello, World!!!" """ | ||
| |> asExe | ||
| |> withPlatform platform | ||
| |> withOptions (if String.IsNullOrWhiteSpace option then [] else [option]) | ||
| |> compile | ||
| |> shouldSucceed | ||
| |> withPeReader(fun rdr -> rdr.PEHeaders.PEHeader.DllCharacteristics) | ||
| |> shouldHaveFlag DllCharacteristics.HighEntropyVirtualAddressSpace |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.