From 7b1d8964466e0543678a53a2e5f5f27bd03171f8 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Thu, 29 Jan 2015 19:13:04 -0800 Subject: [PATCH] fix and tests for #122 - no .volatile emitted on stfld fixes #122 closes #144 commit f138b61d9fc2303d510aa59aff308f6b65fa26b9 Author: Don Syme Date: Thu Jan 29 12:19:37 2015 +0000 enable codegen as smoke tests commit 20b1e81d542a8a3fef891013e5e36a12c5e14fb0 Author: Don Syme Date: Thu Jan 29 12:18:26 2015 +0000 update baselines for tests commit b43c3279767344c5fca2e59ce9f2c3d953d6aaed Merge: 4a83340 d17d429 Author: Don Syme Date: Thu Jan 29 11:59:17 2015 +0000 Merge branch 'fsharp4' of http://github.com/Microsoft/visualfsharp into fix-122 commit 4a833409c30407a7409904ac73baae7f0197a675 Author: Don Syme Date: Thu Jan 29 10:17:43 2015 +0000 NOP commit to run appveyor commit 2fb9f57e5085f709aca6a9bbe03f0ca653a21247 Author: Don Syme Date: Tue Jan 27 17:44:49 2015 +0000 fix and tests for #122 - no .volatile emitted on stfld --- src/fsharp/ilxgen.fs | 9 +- .../generictypestaticfield01.il.netfx4.bsl | 42 +-- .../CodeGen/EmittedIL/Mutation/Mutation05.fs | 13 + .../EmittedIL/Mutation/Mutation05.il.bsl | 249 ++++++++++++++++++ .../Source/CodeGen/EmittedIL/Mutation/env.lst | 1 + .../StaticInit_Class01.il.netfx4.bsl | 37 +-- .../StaticInit_Struct01.il.netfx4.bsl | 51 ++-- tests/fsharpqa/Source/test.lst | 6 +- 8 files changed, 336 insertions(+), 72 deletions(-) create mode 100644 tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.fs create mode 100644 tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.il.bsl diff --git a/src/fsharp/ilxgen.fs b/src/fsharp/ilxgen.fs index 51ed6917eba..6ffaafbef2f 100644 --- a/src/fsharp/ilxgen.fs +++ b/src/fsharp/ilxgen.fs @@ -2232,14 +2232,11 @@ and GenFieldStore isStatic cenv cgbuf eenv (rfref:RecdFieldRef,tyargs,m) sequel if fld.IsMutable && not (useGenuineField rfref.Tycon fld) then let cconv = if isStatic then ILCallingConv.Static else ILCallingConv.Instance let mspec = mkILMethSpecInTy (fspec.EnclosingType, cconv, "set_" + fld.rfield_id.idText, [fspec.FormalType],ILType.Void,[]) - CG.EmitInstr cgbuf (mk_field_pops isStatic 1) Push0 (mkNormalCall mspec) else - // Within assemblies we do generate some set-field operations - // for immutable fields even when resolving recursive bindings. - // However we do not generate "set" properties for these. - // Hence we just set the field directly in this case. - CG.EmitInstr cgbuf (mk_field_pops isStatic 1) Push0 (if isStatic then mkNormalStsfld fspec else mkNormalStfld fspec); + let vol = if rfref.RecdField.IsVolatile then Volatile else Nonvolatile + let instr = if isStatic then I_stsfld (vol, fspec) else I_stfld (ILAlignment.Aligned, vol, fspec) + CG.EmitInstr cgbuf (mk_field_pops isStatic 1) Push0 instr; GenUnitThenSequel cenv eenv m eenv.cloc cgbuf sequel //-------------------------------------------------------------------------- diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/generictypestaticfield01.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/generictypestaticfield01.il.netfx4.bsl index d339d72c736..86915d8ae2e 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/generictypestaticfield01.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Misc/generictypestaticfield01.il.netfx4.bsl @@ -1,5 +1,5 @@ -// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.16774 +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.33440 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:0:0:0 + .ver 4:4:0:9055 } .assembly GenericTypeStaticField01 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.GenericTypeStaticField01 { - // Offset: 0x00000000 Length: 0x0000062C + // Offset: 0x00000000 Length: 0x00000608 } .mresource public FSharpOptimizationData.GenericTypeStaticField01 { - // Offset: 0x00000630 Length: 0x000001F9 + // Offset: 0x00000610 Length: 0x000001E7 } .module GenericTypeStaticField01.exe -// MVID: {4DAC0E02-1E75-7E6B-A745-0383020EAC4D} +// MVID: {54CA24D1-1E75-7E6B-A745-0383D124CA54} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000000000550000 +// Image base: 0x00460000 // =============== CLASS MEMBERS DECLARATION =================== @@ -63,7 +63,7 @@ // Code size 10 (0xa) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 2,2 : 6,9 + .line 2,2 : 6,9 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\Misc\\GenericTypeStaticField01.fs' IL_0000: ldarg.0 IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 @@ -75,16 +75,17 @@ .method private specialname rtspecialname static void .cctor() cil managed { - // Code size 18 (0x12) + // Code size 20 (0x14) .maxstack 8 - .line 3,3 : 10,41 + .line 3,3 : 10,41 '' IL_0000: nop IL_0001: newobj instance void class GenericTypeStaticField01/Foo`1::.ctor() IL_0006: stsfld class GenericTypeStaticField01/Foo`1 class GenericTypeStaticField01/Foo`1::theInstance IL_000b: ldc.i4.1 - IL_000c: stsfld int32 class GenericTypeStaticField01/Foo`1::init@2 - .line 2,2 : 6,9 - IL_0011: ret + IL_000c: volatile. + IL_000e: stsfld int32 class GenericTypeStaticField01/Foo`1::init@2 + .line 2,2 : 6,9 '' + IL_0013: ret } // end of method Foo`1::.cctor .method public specialname static class GenericTypeStaticField01/Foo`1 @@ -92,7 +93,7 @@ { // Code size 27 (0x1b) .maxstack 8 - .line 4,4 : 28,39 + .line 4,4 : 28,39 '' IL_0000: volatile. IL_0002: ldsfld int32 class GenericTypeStaticField01/Foo`1::init@2 IL_0007: ldc.i4.1 @@ -127,7 +128,7 @@ { // Code size 10 (0xa) .maxstack 8 - .line 6,6 : 6,9 + .line 6,6 : 6,9 '' IL_0000: ldarg.0 IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 @@ -139,16 +140,17 @@ .method private specialname rtspecialname static void .cctor() cil managed { - // Code size 18 (0x12) + // Code size 20 (0x14) .maxstack 8 - .line 7,7 : 10,44 + .line 7,7 : 10,44 '' IL_0000: nop IL_0001: newobj instance void class GenericTypeStaticField01/Bar`2::.ctor() IL_0006: stsfld class GenericTypeStaticField01/Bar`2 class GenericTypeStaticField01/Bar`2::theInstance IL_000b: ldc.i4.1 - IL_000c: stsfld int32 class GenericTypeStaticField01/Bar`2::'init@6-1' - .line 6,6 : 6,9 - IL_0011: ret + IL_000c: volatile. + IL_000e: stsfld int32 class GenericTypeStaticField01/Bar`2::'init@6-1' + .line 6,6 : 6,9 '' + IL_0013: ret } // end of method Bar`2::.cctor .method public specialname static class GenericTypeStaticField01/Bar`2 @@ -156,7 +158,7 @@ { // Code size 27 (0x1b) .maxstack 8 - .line 8,8 : 28,39 + .line 8,8 : 28,39 '' IL_0000: volatile. IL_0002: ldsfld int32 class GenericTypeStaticField01/Bar`2::'init@6-1' IL_0007: ldc.i4.1 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.fs b/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.fs new file mode 100644 index 00000000000..c355da097c3 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.fs @@ -0,0 +1,13 @@ +// #Regression #NoMono #NoMT #CodeGen #EmittedIL +type C() = + [] + let mutable x = 1 + + member this.X with get() = x and set v = x <- v + + +type StaticC() = + [] + static let mutable x = 1 + + static member X with get() = x and set v = x <- v diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.il.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.il.bsl new file mode 100644 index 00000000000..1d5278e6be2 --- /dev/null +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/Mutation05.il.bsl @@ -0,0 +1,249 @@ + +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.33440 +// Copyright (c) Microsoft Corporation. All rights reserved. + + + +// 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:0:9055 +} +.assembly Mutation05 +{ + .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.Mutation05 +{ + // Offset: 0x00000000 Length: 0x000004C6 +} +.mresource public FSharpOptimizationData.Mutation05 +{ + // Offset: 0x000004D0 Length: 0x00000127 +} +.module Mutation05.exe +// MVID: {54C7CE57-8C6A-2E22-A745-038357CEC754} +.imagebase 0x00400000 +.file alignment 0x00000200 +.stackreserve 0x00100000 +.subsystem 0x0003 // WINDOWS_CUI +.corflags 0x00000001 // ILONLY +// Image base: 0x001E0000 + + +// =============== CLASS MEMBERS DECLARATION =================== + +.class public abstract auto ansi sealed Mutation05 + 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 ) + .class auto ansi serializable nested public C + extends [mscorlib]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field assembly int32 x + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) + .method public specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 19 (0x13) + .maxstack 8 + .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' + .line 4,4 : 5,22 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\Mutation\\Mutation05.fs' + IL_0000: ldarg.0 + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: nop + IL_0009: ldarg.0 + IL_000a: ldc.i4.1 + IL_000b: volatile. + IL_000d: stfld int32 Mutation05/C::x + .line 2,2 : 6,7 '' + IL_0012: ret + } // end of method C::.ctor + + .method public hidebysig specialname + instance int32 get_X() cil managed + { + // Code size 10 (0xa) + .maxstack 8 + .line 6,6 : 32,33 '' + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: volatile. + IL_0004: ldfld int32 Mutation05/C::x + IL_0009: ret + } // end of method C::get_X + + .method public hidebysig specialname + instance void set_X(int32 v) cil managed + { + // Code size 11 (0xb) + .maxstack 8 + .line 6,6 : 46,52 '' + IL_0000: nop + IL_0001: ldarg.0 + IL_0002: ldarg.1 + IL_0003: volatile. + IL_0005: stfld int32 Mutation05/C::x + IL_000a: ret + } // end of method C::set_X + + .property instance int32 X() + { + .set instance void Mutation05/C::set_X(int32) + .get instance int32 Mutation05/C::get_X() + } // end of property C::X + } // end of class C + + .class auto ansi serializable nested public StaticC + extends [mscorlib]System.Object + { + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 03 00 00 00 00 00 ) + .field static assembly int32 x + .custom instance void [FSharp.Core]Microsoft.FSharp.Core.VolatileFieldAttribute::.ctor() = ( 01 00 00 00 ) + .field static assembly int32 init@9 + .method public specialname rtspecialname + instance void .ctor() cil managed + { + // Code size 10 (0xa) + .maxstack 8 + .line 9,9 : 6,13 '' + IL_0000: ldarg.0 + IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() + IL_0006: ldarg.0 + IL_0007: pop + IL_0008: nop + IL_0009: ret + } // end of method StaticC::.ctor + + .method public specialname static int32 + get_X() cil managed + { + // Code size 33 (0x21) + .maxstack 8 + .line 13,13 : 34,35 '' + IL_0000: volatile. + IL_0002: ldsfld int32 Mutation05/StaticC::init@9 + IL_0007: ldc.i4.1 + IL_0008: bge.s IL_000c + + IL_000a: br.s IL_000e + + IL_000c: br.s IL_0017 + + .line 100001,100001 : 0,0 '' + IL_000e: call void [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::FailStaticInit() + IL_0013: nop + .line 100001,100001 : 0,0 '' + IL_0014: nop + IL_0015: br.s IL_0018 + + .line 100001,100001 : 0,0 '' + .line 100001,100001 : 0,0 '' + IL_0017: nop + IL_0018: nop + IL_0019: volatile. + IL_001b: ldsfld int32 Mutation05/StaticC::x + IL_0020: ret + } // end of method StaticC::get_X + + .method public specialname static void + set_X(int32 v) cil managed + { + // Code size 34 (0x22) + .maxstack 8 + .line 13,13 : 48,54 '' + IL_0000: volatile. + IL_0002: ldsfld int32 Mutation05/StaticC::init@9 + IL_0007: ldc.i4.1 + IL_0008: bge.s IL_000c + + IL_000a: br.s IL_000e + + IL_000c: br.s IL_0017 + + .line 100001,100001 : 0,0 '' + IL_000e: call void [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::FailStaticInit() + IL_0013: nop + .line 100001,100001 : 0,0 '' + IL_0014: nop + IL_0015: br.s IL_0018 + + .line 100001,100001 : 0,0 '' + .line 100001,100001 : 0,0 '' + IL_0017: nop + IL_0018: nop + IL_0019: ldarg.0 + IL_001a: volatile. + IL_001c: stsfld int32 Mutation05/StaticC::x + IL_0021: ret + } // end of method StaticC::set_X + + .method private specialname rtspecialname static + void .cctor() cil managed + { + // Code size 13 (0xd) + .maxstack 8 + .line 100001,100001 : 0,0 '' + IL_0000: ldc.i4.0 + IL_0001: stsfld int32 ''.$Mutation05::init@ + IL_0006: ldsfld int32 ''.$Mutation05::init@ + IL_000b: pop + IL_000c: ret + } // end of method StaticC::.cctor + + .property int32 X() + { + .set void Mutation05/StaticC::set_X(int32) + .get int32 Mutation05/StaticC::get_X() + } // end of property StaticC::X + } // end of class StaticC + +} // end of class Mutation05 + +.class private abstract auto ansi sealed ''.$Mutation05 + extends [mscorlib]System.Object +{ + .field static assembly int32 init@ + .custom instance void [mscorlib]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [mscorlib]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 ) + .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) + .custom instance void [mscorlib]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 ) + .method public static void main@() cil managed + { + .entrypoint + // Code size 18 (0x12) + .maxstack 8 + .line 11,11 : 12,29 '' + IL_0000: nop + IL_0001: ldc.i4.1 + IL_0002: volatile. + IL_0004: stsfld int32 Mutation05/StaticC::x + IL_0009: ldc.i4.1 + IL_000a: volatile. + IL_000c: stsfld int32 Mutation05/StaticC::init@9 + .line 9,9 : 6,13 '' + IL_0011: ret + } // end of method $Mutation05::main@ + +} // end of class ''.$Mutation05 + + +// ============================================================= + +// *********** DISASSEMBLY COMPLETE *********************** diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/env.lst b/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/env.lst index 6f9eea46d59..54eaa12795a 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/env.lst +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/Mutation/env.lst @@ -3,4 +3,5 @@ SOURCE=Mutation02.fs ISCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Mutation02.exe" # Mutation02.fs SOURCE=Mutation03.fs ISCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Mutation03.exe" # Mutation03.fs SOURCE=Mutation04.fs ISCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Mutation04.exe" # Mutation04.fs + SOURCE=Mutation05.fs ISCFLAGS="-g --test:EmitFeeFeeAs100001 --optimize-" COMPILE_ONLY=1 POSTCMD="..\\CompareIL.cmd Mutation05.exe" # Mutation05.fs diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Class01.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Class01.il.netfx4.bsl index 6ddfa38686c..4a11dca3fb9 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Class01.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Class01.il.netfx4.bsl @@ -1,5 +1,5 @@ -// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.16774 +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.33440 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:0:0:0 + .ver 4:4:0:9055 } .assembly StaticInit_Class01 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.StaticInit_Class01 { - // Offset: 0x00000000 Length: 0x00000357 + // Offset: 0x00000000 Length: 0x00000333 } .mresource public FSharpOptimizationData.StaticInit_Class01 { - // Offset: 0x00000360 Length: 0x000000AD + // Offset: 0x00000338 Length: 0x000000AD } .module StaticInit_Class01.dll -// MVID: {4DAC14AB-EC34-E66E-A745-0383AB14AC4D} +// MVID: {54CA2363-EC34-E66E-A745-03836323CA54} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000000000470000 +// Image base: 0x003D0000 // =============== CLASS MEMBERS DECLARATION =================== @@ -63,7 +63,7 @@ // Code size 10 (0xa) .maxstack 8 .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 4,4 : 6,7 + .line 4,4 : 6,7 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\StaticInit\\StaticInit_Class01.fs' IL_0000: ldarg.0 IL_0001: callvirt instance void [mscorlib]System.Object::.ctor() IL_0006: ldarg.0 @@ -77,7 +77,7 @@ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 8 - .line 7,7 : 23,37 + .line 7,7 : 23,37 '' IL_0000: nop IL_0001: volatile. IL_0003: ldsfld int32 StaticInit_ClassS01/C::init@4 @@ -88,15 +88,15 @@ IL_000d: br.s IL_0018 - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' IL_000f: call void [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::FailStaticInit() IL_0014: nop - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' IL_0015: nop IL_0016: br.s IL_0019 - .line 100001,100001 : 0,0 - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' + .line 100001,100001 : 0,0 '' IL_0018: nop IL_0019: ldsfld int32 StaticInit_ClassS01/C::x IL_001e: ldstr "2" @@ -110,7 +110,7 @@ { // Code size 13 (0xd) .maxstack 8 - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' IL_0000: ldc.i4.0 IL_0001: stsfld int32 ''.$StaticInit_ClassS01::init@ IL_0006: ldsfld int32 ''.$StaticInit_ClassS01::init@ @@ -132,17 +132,18 @@ .method private specialname rtspecialname static void .cctor() cil managed { - // Code size 23 (0x17) + // Code size 25 (0x19) .maxstack 8 - .line 6,6 : 12,30 + .line 6,6 : 12,30 '' IL_0000: nop IL_0001: ldstr "1" IL_0006: callvirt instance int32 [mscorlib]System.String::get_Length() IL_000b: stsfld int32 StaticInit_ClassS01/C::x IL_0010: ldc.i4.1 - IL_0011: stsfld int32 StaticInit_ClassS01/C::init@4 - .line 4,4 : 6,7 - IL_0016: ret + IL_0011: volatile. + IL_0013: stsfld int32 StaticInit_ClassS01/C::init@4 + .line 4,4 : 6,7 '' + IL_0018: ret } // end of method $StaticInit_ClassS01::.cctor } // end of class ''.$StaticInit_ClassS01 diff --git a/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Struct01.il.netfx4.bsl b/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Struct01.il.netfx4.bsl index a4c2b81e6a6..74746b1c3b0 100644 --- a/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Struct01.il.netfx4.bsl +++ b/tests/fsharpqa/Source/CodeGen/EmittedIL/StaticInit/StaticInit_Struct01.il.netfx4.bsl @@ -1,5 +1,5 @@ -// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.16774 +// Microsoft (R) .NET Framework IL Disassembler. Version 4.0.30319.33440 // Copyright (c) Microsoft Corporation. All rights reserved. @@ -13,7 +13,7 @@ .assembly extern FSharp.Core { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) // .?_....: - .ver 4:0:0:0 + .ver 4:4:0:9055 } .assembly StaticInit_Struct01 { @@ -29,20 +29,20 @@ } .mresource public FSharpSignatureData.StaticInit_Struct01 { - // Offset: 0x00000000 Length: 0x000007CD + // Offset: 0x00000000 Length: 0x000007B1 } .mresource public FSharpOptimizationData.StaticInit_Struct01 { - // Offset: 0x000007D8 Length: 0x0000021F + // Offset: 0x000007B8 Length: 0x0000021F } .module StaticInit_Struct01.dll -// MVID: {4DAC14A8-05F6-D6CB-A745-0383A814AC4D} +// MVID: {54CA235E-05F6-D6CB-A745-03835E23CA54} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY -// Image base: 0x0000000000180000 +// Image base: 0x00440000 // =============== CLASS MEMBERS DECLARATION =================== @@ -71,7 +71,7 @@ .maxstack 5 .locals init ([0] valuetype StaticInit_Struct01/C& V_0) .language '{AB4F38C9-B6E6-43BA-BE3B-58080B2CCCE3}', '{994B45C4-E6E9-11D2-903F-00C04FA302A1}', '{5A869D0B-6611-11D3-BD2A-0000F80849BD}' - .line 4,4 : 6,7 + .line 4,4 : 6,7 'C:\\GitHub\\dsyme\\visualfsharp\\tests\\fsharpqa\\Source\\CodeGen\\EmittedIL\\StaticInit\\StaticInit_Struct01.fs' IL_0000: nop IL_0001: ldarga.s obj IL_0003: stloc.0 @@ -93,7 +93,7 @@ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 14 (0xe) .maxstack 8 - .line 4,4 : 6,7 + .line 4,4 : 6,7 '' IL_0000: nop IL_0001: ldarg.0 IL_0002: ldarg.1 @@ -111,7 +111,7 @@ .maxstack 5 .locals init ([0] valuetype StaticInit_Struct01/C V_0, [1] valuetype StaticInit_Struct01/C& V_1) - .line 4,4 : 6,7 + .line 4,4 : 6,7 '' IL_0000: nop IL_0001: ldarg.1 IL_0002: unbox.any StaticInit_Struct01/C @@ -137,7 +137,7 @@ // Code size 32 (0x20) .maxstack 7 .locals init ([0] int32 V_0) - .line 4,4 : 6,7 + .line 4,4 : 6,7 '' IL_0000: nop IL_0001: ldc.i4.0 IL_0002: stloc.0 @@ -167,7 +167,7 @@ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 13 (0xd) .maxstack 8 - .line 4,4 : 6,7 + .line 4,4 : 6,7 '' IL_0000: nop IL_0001: ldarg.0 IL_0002: call class [mscorlib]System.Collections.IEqualityComparer [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives::get_GenericEqualityComparer() @@ -216,12 +216,12 @@ { // Code size 9 (0x9) .maxstack 8 - .line 4,4 : 8,9 + .line 4,4 : 8,9 '' IL_0000: nop IL_0001: ldarg.0 IL_0002: ldarg.1 IL_0003: stfld valuetype [mscorlib]System.DateTime StaticInit_Struct01/C::s - .line 4,4 : 6,7 + .line 4,4 : 6,7 '' IL_0008: ret } // end of method C::.ctor @@ -230,7 +230,7 @@ .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 8 - .line 7,7 : 23,37 + .line 7,7 : 23,37 '' IL_0000: nop IL_0001: volatile. IL_0003: ldsfld int32 StaticInit_Struct01/C::init@4 @@ -241,15 +241,15 @@ IL_000d: br.s IL_0018 - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' IL_000f: call void [FSharp.Core]Microsoft.FSharp.Core.LanguagePrimitives/IntrinsicFunctions::FailStaticInit() IL_0014: nop - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' IL_0015: nop IL_0016: br.s IL_0019 - .line 100001,100001 : 0,0 - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' + .line 100001,100001 : 0,0 '' IL_0018: nop IL_0019: ldsfld int32 StaticInit_Struct01/C::x IL_001e: ldstr "2" @@ -265,7 +265,7 @@ // Code size 24 (0x18) .maxstack 4 .locals init ([0] valuetype StaticInit_Struct01/C& V_0) - .line 4,4 : 6,7 + .line 4,4 : 6,7 '' IL_0000: nop IL_0001: ldarga.s obj IL_0003: stloc.0 @@ -310,7 +310,7 @@ { // Code size 13 (0xd) .maxstack 8 - .line 100001,100001 : 0,0 + .line 100001,100001 : 0,0 '' IL_0000: ldc.i4.0 IL_0001: stsfld int32 ''.$StaticInit_Struct01::init@ IL_0006: ldsfld int32 ''.$StaticInit_Struct01::init@ @@ -332,17 +332,18 @@ .method private specialname rtspecialname static void .cctor() cil managed { - // Code size 23 (0x17) + // Code size 25 (0x19) .maxstack 8 - .line 6,6 : 12,30 + .line 6,6 : 12,30 '' IL_0000: nop IL_0001: ldstr "1" IL_0006: callvirt instance int32 [mscorlib]System.String::get_Length() IL_000b: stsfld int32 StaticInit_Struct01/C::x IL_0010: ldc.i4.1 - IL_0011: stsfld int32 StaticInit_Struct01/C::init@4 - .line 4,4 : 6,7 - IL_0016: ret + IL_0011: volatile. + IL_0013: stsfld int32 StaticInit_Struct01/C::init@4 + .line 4,4 : 6,7 '' + IL_0018: ret } // end of method $StaticInit_Struct01::.cctor } // end of class ''.$StaticInit_Struct01 diff --git a/tests/fsharpqa/Source/test.lst b/tests/fsharpqa/Source/test.lst index a1e447ee807..fb2a0f7788a 100644 --- a/tests/fsharpqa/Source/test.lst +++ b/tests/fsharpqa/Source/test.lst @@ -16,14 +16,14 @@ CodeGen01,NoMT CodeGen\EmittedIL\GeneratedIterators CodeGen01,NoMT CodeGen\EmittedIL\InequalityComparison CodeGen01,NoMT CodeGen\EmittedIL\ListExpressionStepping CodeGen01,NoMT CodeGen\EmittedIL\MethodImplAttribute -CodeGen01,NoMT CodeGen\EmittedIL\Misc -CodeGen01,NoMT CodeGen\EmittedIL\Mutation +CodeGen01,NoMT,Smoke CodeGen\EmittedIL\Misc +CodeGen01,CodeGenMutation,NoMT CodeGen\EmittedIL\Mutation CodeGen01,NoMT CodeGen\EmittedIL\Operators CodeGen01,NoMT CodeGen\EmittedIL\QueryExpressionStepping CodeGen01,NoMT CodeGen\EmittedIL\SeqExpressionStepping CodeGen01,NoMT CodeGen\EmittedIL\SeqExpressionTailCalls CodeGen01,NoMT CodeGen\EmittedIL\SerializableAttribute -CodeGen01,NoMT CodeGen\EmittedIL\StaticInit +CodeGen01,NoMT,Smoke CodeGen\EmittedIL\StaticInit CodeGen01,NoMT CodeGen\EmittedIL\SteppingMatch CodeGen01,NoMT CodeGen\EmittedIL\TailCalls CodeGen01,NoMT CodeGen\EmittedIL\TestFunctions