diff --git a/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs b/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs new file mode 100644 index 00000000000..7431bd0397c --- /dev/null +++ b/tests/fsharp/Compiler/CodeGen/EmittedIL/LiteralValue.fs @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information. + +namespace FSharp.Compiler.UnitTests.CodeGen.EmittedIL + +open FSharp.Compiler.UnitTests +open NUnit.Framework + +[] +module ``Literal Value`` = + + [] + let ``Literal Value``() = + CompilerAssert.CompileLibraryAndVerifyIL + """ +module LiteralValue + +[] +let x = 7 + +[] +let main _ = + 0 + """ + (fun verifier -> verifier.VerifyIL [ + """ +.field public static literal int32 x = int32(0x00000007) + """ + ]) diff --git a/tests/fsharp/Compiler/ILChecker.fs b/tests/fsharp/Compiler/ILChecker.fs index 200206f861f..23e07decae6 100644 --- a/tests/fsharp/Compiler/ILChecker.fs +++ b/tests/fsharp/Compiler/ILChecker.fs @@ -54,6 +54,7 @@ module ILChecker = |> filterSpecialComment expectedIL + |> List.map (fun (ilCode: string) -> ilCode.Trim() ) |> List.iter (fun (ilCode: string) -> let expectedLines = ilCode.Split('\n') let startIndex = textNoComments.IndexOf(expectedLines.[0]) diff --git a/tests/fsharp/FSharpSuite.Tests.fsproj b/tests/fsharp/FSharpSuite.Tests.fsproj index 21b9367ec3a..48da68d100e 100644 --- a/tests/fsharp/FSharpSuite.Tests.fsproj +++ b/tests/fsharp/FSharpSuite.Tests.fsproj @@ -32,6 +32,7 @@ + diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs deleted file mode 100644 index cca0b9e0e2f..00000000000 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.fs +++ /dev/null @@ -1,6 +0,0 @@ -[] -let x = 7 - -[] -let main argv = - 0 \ No newline at end of file diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl deleted file mode 100644 index 32a104642ee..00000000000 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/LiteralValue.il.bsl +++ /dev/null @@ -1,81 +0,0 @@ - -// Microsoft (R) .NET Framework IL Disassembler. Version 4.5.22220.0 - - - -// Metadata version: v4.0.30319 -.assembly extern mscorlib -{ - .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. - .ver 4:0:0:0 -} -.assembly extern FSharp.Core -{ - .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:4:3:0 -} -.assembly LiteralValue -{ - .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 ) - - // --- The following custom attribute is added automatically, do not uncomment ------- - // .custom instance void [mscorlib]System.Diagnostics.DebuggableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggableAttribute/DebuggingModes) = ( 01 00 01 01 00 00 00 00 ) - - .hash algorithm 0x00008004 - .ver 0:0:0:0 -} -.mresource public FSharpSignatureData.LiteralValue -{ - // Offset: 0x00000000 Length: 0x00000274 - // WARNING: managed resource file FSharpSignatureData.test created -} -.mresource public FSharpOptimizationData.LiteralValue -{ - // Offset: 0x00000278 Length: 0x0000006F - // WARNING: managed resource file FSharpOptimizationData.test created -} -.module LiteralValue.exe - // MVID: {5AA663EB-D9C1-2E4E-A745-0383EB63A65A} -.imagebase 0x00400000 -.file alignment 0x00000200 -.stackreserve 0x00100000 -.subsystem 0x0003 // WINDOWS_CUI -.corflags 0x00000001 // ILONLY -// Image base: 0x02BF0000 - - -// =============== CLASS MEMBERS DECLARATION =================== - -.class public abstract auto ansi sealed LiteralValue - extends [mscorlib]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 public static literal int32 x = int32(0x00000007) - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.LiteralAttribute::.ctor() = ( 01 00 00 00 ) - .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) - .method public static int32 main(string[] argv) cil managed - { - .entrypoint - .custom instance void [FSharp.Core]Microsoft.FSharp.Core.EntryPointAttribute::.ctor() = ( 01 00 00 00 ) - // Code size 2 (0x2) - .maxstack 8 - .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 6,6 : 5,6 'D:\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\LiteralValue\\LiteralValue.fs' - IL_0000: ldc.i4.0 - IL_0001: ret - } // end of method LiteralValue::main - -} // end of class LiteralValue - -.class private abstract auto ansi sealed ''.$LiteralValue - extends [mscorlib]System.Object -{ -} // end of class ''.$LiteralValue - - -// ============================================================= - -// *********** DISASSEMBLY COMPLETE *********************** -// WARNING: Created Win32 resource file test.res diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst deleted file mode 100644 index 5566c4d1da8..00000000000 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/LiteralValue/env.lst +++ /dev/null @@ -1 +0,0 @@ - SOURCE=LiteralValue.fs SCFLAGS="-g --test:LiteralValue --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd LiteralValue.exe" # LiteralValue.fs - \ No newline at end of file