-
Notifications
You must be signed in to change notification settings - Fork 794
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15240 from dotnet/merges/main-to-release/dev17.7
Merge main to release/dev17.7
- Loading branch information
Showing
18 changed files
with
130 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/crossoptimize.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
58 changes: 58 additions & 0 deletions
58
tests/FSharp.Compiler.ComponentTests/CompilerOptions/fsc/highentropyva.fs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
tests/fsharpqa/Source/CompilerOptions/fsc/crossoptimize/crossoptimize01.fs
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
tests/fsharpqa/Source/CompilerOptions/fsc/crossoptimize/env.lst
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
tests/fsharpqa/Source/CompilerOptions/fsc/highentropyva/CheckHighEntropyASLR.bat
This file was deleted.
Oops, something went wrong.
2 changes: 0 additions & 2 deletions
2
tests/fsharpqa/Source/CompilerOptions/fsc/highentropyva/dummy.fs
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
tests/fsharpqa/Source/CompilerOptions/fsc/highentropyva/env.lst
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion-culture.fsx
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion-decimal.fsx
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/badlangversion.fsx
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/dummy.fsx
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/env.lst
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
tests/fsharpqa/Source/CompilerOptions/fsc/langversion/langversionhelp.437.1033.bsl
This file was deleted.
Oops, something went wrong.