Skip to content

Commit 9004c7c

Browse files
authored
Tests/emitted IL: split some baselines into optimize+/optimize- (#19676)
1 parent de1f400 commit 9004c7c

106 files changed

Lines changed: 12167 additions & 1043 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionStepping.fs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,45 +10,44 @@ module AsyncExpressionStepping =
1010
compilation
1111
|> asFs
1212
|> withOptions [ "--test:EmitFeeFeeAs100001" ]
13-
|> withNoOptimize
1413
|> withEmbeddedPdb
1514
|> withEmbedAllSource
1615
|> ignoreWarnings
1716
|> compile
1817
|> verifyBaseline
1918
|> verifyILBaseline
2019

21-
[<Theory; FileInlineData("AsyncExpressionSteppingTest1.fs", Realsig=BooleanOptions.Both)>]
20+
[<Theory; FileInlineData("AsyncExpressionSteppingTest1.fs", Realsig = BooleanOptions.Both, Optimize = BooleanOptions.Both)>]
2221
let ``AsyncExpressionSteppingTest1_fs`` compilation =
2322
compilation
2423
|> getCompilation
2524
|> verifyCompilation
2625

27-
[<Theory; FileInlineData("AsyncExpressionSteppingTest2.fs", Realsig=BooleanOptions.Both)>]
26+
[<Theory; FileInlineData("AsyncExpressionSteppingTest2.fs", Realsig=BooleanOptions.Both, Optimize = BooleanOptions.Both)>]
2827
let ``AsyncExpressionSteppingTest2`` compilation =
2928
compilation
3029
|> getCompilation
3130
|> verifyCompilation
3231

33-
[<Theory; FileInlineData("AsyncExpressionSteppingTest3.fs", Realsig=BooleanOptions.Both)>]
32+
[<Theory; FileInlineData("AsyncExpressionSteppingTest3.fs", Realsig=BooleanOptions.Both, Optimize = BooleanOptions.Both)>]
3433
let ``AsyncExpressionSteppingTest3_fs`` compilation =
3534
compilation
3635
|> getCompilation
3736
|> verifyCompilation
3837

39-
[<Theory; FileInlineData("AsyncExpressionSteppingTest4.fs", Realsig=BooleanOptions.Both)>]
38+
[<Theory; FileInlineData("AsyncExpressionSteppingTest4.fs", Realsig=BooleanOptions.Both, Optimize = BooleanOptions.Both)>]
4039
let ``AsyncExpressionSteppingTest4_fs`` compilation =
4140
compilation
4241
|> getCompilation
4342
|> verifyCompilation
4443

45-
[<Theory; FileInlineData("AsyncExpressionSteppingTest5.fs", Realsig=BooleanOptions.Both)>]
44+
[<Theory; FileInlineData("AsyncExpressionSteppingTest5.fs", Realsig=BooleanOptions.Both, Optimize = BooleanOptions.Both)>]
4645
let ``AsyncExpressionSteppingTest5_fs`` compilation =
4746
compilation
4847
|> getCompilation
4948
|> verifyCompilation
5049

51-
[<Theory; FileInlineData("AsyncExpressionSteppingTest6.fs", Realsig=BooleanOptions.Both)>]
50+
[<Theory; FileInlineData("AsyncExpressionSteppingTest6.fs", Realsig=BooleanOptions.Both, Optimize = BooleanOptions.Both)>]
5251
let ``AsyncExpressionSteppingTest6_fs`` compilation =
5352
compilation
5453
|> getCompilation

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.fs.RealInternalSignatureOff.il.bsl renamed to tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.fs.RealInternalSignatureOff.OptimizeOff.il.bsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,4 +135,3 @@
135135

136136

137137

138-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
2+
3+
4+
5+
6+
.assembly extern runtime { }
7+
.assembly extern FSharp.Core { }
8+
.assembly extern netstandard
9+
{
10+
.publickeytoken = (CC 7B 13 FF CD 2D DD 51 )
11+
.ver 2:1:0:0
12+
}
13+
.assembly assembly
14+
{
15+
.custom instance void [FSharp.Core]Microsoft.FSharp.Core.FSharpInterfaceDataVersionAttribute::.ctor(int32,
16+
int32,
17+
int32) = ( 01 00 02 00 00 00 00 00 00 00 00 00 00 00 00 00 )
18+
19+
20+
21+
22+
.hash algorithm 0x00008004
23+
.ver 0:0:0:0
24+
}
25+
.module assembly.dll
26+
27+
.imagebase {value}
28+
.file alignment 0x00000200
29+
.stackreserve 0x00100000
30+
.subsystem 0x0003
31+
.corflags 0x00000001
32+
33+
34+
35+
36+
37+
.class public abstract auto ansi sealed assembly
38+
extends [runtime]System.Object
39+
{
40+
.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 )
41+
.class abstract auto ansi sealed nested public assembly
42+
extends [runtime]System.Object
43+
{
44+
.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 )
45+
.class auto ansi serializable sealed nested assembly beforefieldinit f1@6
46+
extends class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit>>
47+
{
48+
.field static assembly initonly class assembly/assembly/f1@6 @_instance
49+
.method assembly specialname rtspecialname instance void .ctor() cil managed
50+
{
51+
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
52+
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
53+
54+
.maxstack 8
55+
IL_0000: ldarg.0
56+
IL_0001: call instance void class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit>>::.ctor()
57+
IL_0006: ret
58+
}
59+
60+
.method public strict virtual instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> Invoke(class [FSharp.Core]Microsoft.FSharp.Core.Unit unitVar) cil managed
61+
{
62+
63+
.maxstack 6
64+
.locals init (class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit> V_0)
65+
IL_0000: ldstr "hello"
66+
IL_0005: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::.ctor(string)
67+
IL_000a: stloc.0
68+
IL_000b: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out()
69+
IL_0010: ldloc.0
70+
IL_0011: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter<class [FSharp.Core]Microsoft.FSharp.Core.Unit>(class [runtime]System.IO.TextWriter,
71+
class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>)
72+
IL_0016: pop
73+
IL_0017: ldstr "stuck in the middle"
74+
IL_001c: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::.ctor(string)
75+
IL_0021: stloc.0
76+
IL_0022: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out()
77+
IL_0027: ldloc.0
78+
IL_0028: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter<class [FSharp.Core]Microsoft.FSharp.Core.Unit>(class [runtime]System.IO.TextWriter,
79+
class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>)
80+
IL_002d: pop
81+
IL_002e: ldstr "goodbye"
82+
IL_0033: newobj instance void class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`5<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>::.ctor(string)
83+
IL_0038: stloc.0
84+
IL_0039: call class [netstandard]System.IO.TextWriter [netstandard]System.Console::get_Out()
85+
IL_003e: ldloc.0
86+
IL_003f: call !!0 [FSharp.Core]Microsoft.FSharp.Core.PrintfModule::PrintFormatLineToTextWriter<class [FSharp.Core]Microsoft.FSharp.Core.Unit>(class [runtime]System.IO.TextWriter,
87+
class [FSharp.Core]Microsoft.FSharp.Core.PrintfFormat`4<!!0,class [runtime]System.IO.TextWriter,class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Core.Unit>)
88+
IL_0044: pop
89+
IL_0045: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder()
90+
IL_004a: tail.
91+
IL_004c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Zero()
92+
IL_0051: ret
93+
}
94+
95+
.method private specialname rtspecialname static void .cctor() cil managed
96+
{
97+
98+
.maxstack 10
99+
IL_0000: newobj instance void assembly/assembly/f1@6::.ctor()
100+
IL_0005: stsfld class assembly/assembly/f1@6 assembly/assembly/f1@6::@_instance
101+
IL_000a: ret
102+
}
103+
104+
}
105+
106+
.method public static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> f1() cil managed
107+
{
108+
109+
.maxstack 8
110+
IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder [FSharp.Core]Microsoft.FSharp.Core.ExtraTopLevelOperators::get_DefaultAsyncBuilder()
111+
IL_0005: ldsfld class assembly/assembly/f1@6 assembly/assembly/f1@6::@_instance
112+
IL_000a: tail.
113+
IL_000c: callvirt instance class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0> [FSharp.Core]Microsoft.FSharp.Control.FSharpAsyncBuilder::Delay<class [FSharp.Core]Microsoft.FSharp.Core.Unit>(class [FSharp.Core]Microsoft.FSharp.Core.FSharpFunc`2<class [FSharp.Core]Microsoft.FSharp.Core.Unit,class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0>>)
114+
IL_0011: ret
115+
}
116+
117+
.method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> get_arg@1() cil managed
118+
{
119+
120+
.maxstack 8
121+
IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> '<StartupCode$assembly>'.$assembly::arg@1
122+
IL_0005: ret
123+
}
124+
125+
.method assembly specialname static class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> get_computation@10() cil managed
126+
{
127+
128+
.maxstack 8
129+
IL_0000: ldsfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> '<StartupCode$assembly>'.$assembly::computation@10
130+
IL_0005: ret
131+
}
132+
133+
.property class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit>
134+
arg@1()
135+
{
136+
.custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 )
137+
.get class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly/assembly::get_arg@1()
138+
}
139+
.property class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit>
140+
computation@10()
141+
{
142+
.custom instance void [FSharp.Core]Microsoft.FSharp.Core.CompilationMappingAttribute::.ctor(valuetype [FSharp.Core]Microsoft.FSharp.Core.SourceConstructFlags) = ( 01 00 09 00 00 00 00 00 )
143+
.get class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly/assembly::get_computation@10()
144+
}
145+
}
146+
147+
}
148+
149+
.class private abstract auto ansi sealed '<StartupCode$assembly>'.$assembly
150+
extends [runtime]System.Object
151+
{
152+
.field static assembly initonly class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> arg@1
153+
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
154+
.field static assembly initonly class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> computation@10
155+
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
156+
.field static assembly int32 init@
157+
.custom instance void [runtime]System.Diagnostics.DebuggerBrowsableAttribute::.ctor(valuetype [runtime]System.Diagnostics.DebuggerBrowsableState) = ( 01 00 00 00 00 00 00 00 )
158+
.custom instance void [runtime]System.Runtime.CompilerServices.CompilerGeneratedAttribute::.ctor() = ( 01 00 00 00 )
159+
.custom instance void [runtime]System.Diagnostics.DebuggerNonUserCodeAttribute::.ctor() = ( 01 00 00 00 )
160+
.method private specialname rtspecialname static void .cctor() cil managed
161+
{
162+
163+
.maxstack 8
164+
IL_0000: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly/assembly::f1()
165+
IL_0005: stsfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> '<StartupCode$assembly>'.$assembly::arg@1
166+
IL_000a: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly/assembly::get_arg@1()
167+
IL_000f: stsfld class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> '<StartupCode$assembly>'.$assembly::computation@10
168+
IL_0014: call class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<class [FSharp.Core]Microsoft.FSharp.Core.Unit> assembly/assembly::get_computation@10()
169+
IL_0019: ldnull
170+
IL_001a: ldnull
171+
IL_001b: call !!0 [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync::RunSynchronously<class [FSharp.Core]Microsoft.FSharp.Core.Unit>(class [FSharp.Core]Microsoft.FSharp.Control.FSharpAsync`1<!!0>,
172+
class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1<int32>,
173+
class [FSharp.Core]Microsoft.FSharp.Core.FSharpOption`1<valuetype [runtime]System.Threading.CancellationToken>)
174+
IL_0020: pop
175+
IL_0021: ret
176+
}
177+
178+
}
179+
180+
181+
182+
183+

tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.fs.RealInternalSignatureOn.il.bsl renamed to tests/FSharp.Compiler.ComponentTests/EmittedIL/AsyncExpressionStepping/AsyncExpressionSteppingTest1.fs.RealInternalSignatureOn.OptimizeOff.il.bsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,3 @@
173173

174174

175175

176-

0 commit comments

Comments
 (0)