Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit e76d09a

Browse files
committed
Add large version bubble test
1 parent 2243d12 commit e76d09a

File tree

8 files changed

+208
-44
lines changed

8 files changed

+208
-44
lines changed

src/jit/importer.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19186,7 +19186,6 @@ void Compiler::impMarkInlineCandidate(GenTree* callNode,
1918619186
inlineResult.NoteFatal(InlineObservation::CALLSITE_IS_CALL_TO_HELPER);
1918719187
return;
1918819188
}
19189-
1919019189
/* Ignore indirect calls */
1919119190
if (call->gtCallType == CT_INDIRECT)
1919219191
{

tests/runtest.cmd

Lines changed: 48 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -59,50 +59,52 @@ if /i "%1" == "-h" goto Usage
5959
if /i "%1" == "/help" goto Usage
6060
if /i "%1" == "-help" goto Usage
6161

62-
if /i "%1" == "x64" (set __BuildArch=x64&shift&goto Arg_Loop)
63-
if /i "%1" == "x86" (set __BuildArch=x86&shift&goto Arg_Loop)
64-
if /i "%1" == "arm" (set __BuildArch=arm&shift&goto Arg_Loop)
65-
if /i "%1" == "arm64" (set __BuildArch=arm64&shift&goto Arg_Loop)
66-
67-
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
68-
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
69-
if /i "%1" == "checked" (set __BuildType=Checked&shift&goto Arg_Loop)
70-
71-
if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop)
72-
if /i "%1" == "vs2017" (set __VSVersion=%1&shift&goto Arg_Loop)
73-
74-
if /i "%1" == "TestEnv" (set __TestEnv=%2&shift&shift&goto Arg_Loop)
75-
if /i "%1" == "AgainstPackages" (set __AgainstPackages=1&shift&goto Arg_Loop)
76-
if /i "%1" == "sequential" (set __Sequential=1&shift&goto Arg_Loop)
77-
if /i "%1" == "crossgen" (set __DoCrossgen=1&shift&goto Arg_Loop)
78-
if /i "%1" == "crossgenaltjit" (set __DoCrossgen=1&set __CrossgenAltJit=%2&shift&shift&goto Arg_Loop)
79-
if /i "%1" == "longgc" (set __LongGCTests=1&shift&goto Arg_Loop)
80-
if /i "%1" == "gcsimulator" (set __GCSimulatorTests=1&shift&goto Arg_Loop)
81-
if /i "%1" == "jitstress" (set COMPlus_JitStress=%2&shift&shift&goto Arg_Loop)
82-
if /i "%1" == "jitstressregs" (set COMPlus_JitStressRegs=%2&shift&shift&goto Arg_Loop)
83-
if /i "%1" == "jitminopts" (set COMPlus_JITMinOpts=1&shift&goto Arg_Loop)
84-
if /i "%1" == "jitforcerelocs" (set COMPlus_ForceRelocs=1&shift&goto Arg_Loop)
85-
if /i "%1" == "jitdisasm" (set __JitDisasm=1&shift&goto Arg_Loop)
86-
if /i "%1" == "ilasmroundtrip" (set __IlasmRoundTrip=1&shift&goto Arg_Loop)
87-
if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&shift&goto Arg_Loop)
88-
if /i "%1" == "skipgeneratelayout" (set __SkipGenerateLayout=1&shift&goto Arg_Loop)
89-
if /i "%1" == "buildxunitwrappers" (set __BuildXunitWrappers=1&shift&goto Arg_Loop)
90-
if /i "%1" == "printlastresultsonly" (set __PrintLastResultsOnly=1&shift&goto Arg_Loop)
91-
if /i "%1" == "PerfTests" (set __PerfTests=true&shift&goto Arg_Loop)
92-
if /i "%1" == "CoreFXTests" (set __CoreFXTests=true&shift&goto Arg_Loop)
93-
if /i "%1" == "CoreFXTestsAll" (set __CoreFXTests=true&set __CoreFXTestsRunAllAvailable=true&shift&goto Arg_Loop)
94-
if /i "%1" == "CoreFXTestList" (set __CoreFXTests=true&set __CoreFXTestList=%2&shift&shift&goto Arg_Loop)
95-
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
96-
if /i "%1" == "link" (set DoLink=true&set ILLINK=%2&shift&shift&goto Arg_Loop)
62+
if /i "%1" == "x64" (set __BuildArch=x64&shift&goto Arg_Loop)
63+
if /i "%1" == "x86" (set __BuildArch=x86&shift&goto Arg_Loop)
64+
if /i "%1" == "arm" (set __BuildArch=arm&shift&goto Arg_Loop)
65+
if /i "%1" == "arm64" (set __BuildArch=arm64&shift&goto Arg_Loop)
66+
67+
if /i "%1" == "debug" (set __BuildType=Debug&shift&goto Arg_Loop)
68+
if /i "%1" == "release" (set __BuildType=Release&shift&goto Arg_Loop)
69+
if /i "%1" == "checked" (set __BuildType=Checked&shift&goto Arg_Loop)
70+
71+
if /i "%1" == "vs2015" (set __VSVersion=%1&shift&goto Arg_Loop)
72+
if /i "%1" == "vs2017" (set __VSVersion=%1&shift&goto Arg_Loop)
73+
74+
if /i "%1" == "TestEnv" (set __TestEnv=%2&shift&shift&goto Arg_Loop)
75+
if /i "%1" == "AgainstPackages" (set __AgainstPackages=1&shift&goto Arg_Loop)
76+
if /i "%1" == "sequential" (set __Sequential=1&shift&goto Arg_Loop)
77+
if /i "%1" == "crossgen" (set __DoCrossgen=1&shift&goto Arg_Loop)
78+
if /i "%1" == "crossgenaltjit" (set __DoCrossgen=1&set __CrossgenAltJit=%2&shift&shift&goto Arg_Loop)
79+
if /i "%1" == "longgc" (set __LongGCTests=1&shift&goto Arg_Loop)
80+
if /i "%1" == "gcsimulator" (set __GCSimulatorTests=1&shift&goto Arg_Loop)
81+
if /i "%1" == "jitstress" (set COMPlus_JitStress=%2&shift&shift&goto Arg_Loop)
82+
if /i "%1" == "jitstressregs" (set COMPlus_JitStressRegs=%2&shift&shift&goto Arg_Loop)
83+
if /i "%1" == "jitminopts" (set COMPlus_JITMinOpts=1&shift&goto Arg_Loop)
84+
if /i "%1" == "jitforcerelocs" (set COMPlus_ForceRelocs=1&shift&goto Arg_Loop)
85+
if /i "%1" == "jitdisasm" (set __JitDisasm=1&shift&goto Arg_Loop)
86+
if /i "%1" == "ilasmroundtrip" (set __IlasmRoundTrip=1&shift&goto Arg_Loop)
87+
if /i "%1" == "GenerateLayoutOnly" (set __GenerateLayoutOnly=1&shift&goto Arg_Loop)
88+
if /i "%1" == "skipgeneratelayout" (set __SkipGenerateLayout=1&shift&goto Arg_Loop)
89+
if /i "%1" == "buildxunitwrappers" (set __BuildXunitWrappers=1&shift&goto Arg_Loop)
90+
if /i "%1" == "printlastresultsonly" (set __PrintLastResultsOnly=1&shift&goto Arg_Loop)
91+
if /i "%1" == "PerfTests" (set __PerfTests=true&shift&goto Arg_Loop)
92+
if /i "%1" == "CoreFXTests" (set __CoreFXTests=true&shift&goto Arg_Loop)
93+
if /i "%1" == "CoreFXTestsAll" (set __CoreFXTests=true&set __CoreFXTestsRunAllAvailable=true&shift&goto Arg_Loop)
94+
if /i "%1" == "CoreFXTestList" (set __CoreFXTests=true&set __CoreFXTestList=%2&shift&shift&goto Arg_Loop)
95+
if /i "%1" == "runcrossgentests" (set RunCrossGen=true&shift&goto Arg_Loop)
96+
// This test feature is currently intentionally undocumented
97+
if /i "%1" == "runlargeversionbubblecrossgentests" (set RunCrossGen=true&set CrossgenLargeVersionBubble=true&shift&goto Arg_Loop)
98+
if /i "%1" == "link" (set DoLink=true&set ILLINK=%2&shift&shift&goto Arg_Loop)
9799
REM tieredcompilation is on by default now, but setting this environment variable is harmless and I didn't want to break any automation that might be using it just yet
98-
if /i "%1" == "tieredcompilation" (set COMPLUS_TieredCompilation=1&shift&goto Arg_Loop)
99-
if /i "%1" == "gcname" (set COMPlus_GCName=%2&shift&shift&goto Arg_Loop)
100-
if /i "%1" == "timeout" (set __TestTimeout=%2&shift&shift&goto Arg_Loop)
101-
if /i "%1" == "altjitarch" (set __AltJitArch=%2&shift&shift&goto Arg_Loop)
100+
if /i "%1" == "tieredcompilation" (set COMPLUS_TieredCompilation=1&shift&goto Arg_Loop)
101+
if /i "%1" == "gcname" (set COMPlus_GCName=%2&shift&shift&goto Arg_Loop)
102+
if /i "%1" == "timeout" (set __TestTimeout=%2&shift&shift&goto Arg_Loop)
103+
if /i "%1" == "altjitarch" (set __AltJitArch=%2&shift&shift&goto Arg_Loop)
102104

103105
REM change it to COMPlus_GCStress when we stop using xunit harness
104-
if /i "%1" == "gcstresslevel" (set COMPlus_GCStress=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
105-
if /i "%1" == "collectdumps" (set __CollectDumps=true&shift&goto Arg_Loop)
106+
if /i "%1" == "gcstresslevel" (set COMPlus_GCStress=%2&set __TestTimeout=1800000&shift&shift&goto Arg_Loop)
107+
if /i "%1" == "collectdumps" (set __CollectDumps=true&shift&goto Arg_Loop)
106108

107109
if /i not "%1" == "msbuildargs" goto SkipMsbuildArgs
108110
:: All the rest of the args will be collected and passed directly to msbuild.
@@ -205,6 +207,11 @@ if defined __DoCrossgen (
205207
set __RuntestPyArgs=%__RuntestPyArgs% --precompile_core_root
206208
)
207209

210+
if defined CrossgenLargeVersionBubble
211+
(
212+
set __RuntestPyArgs=%__RuntestPyArgs% --large_version_bubble
213+
)
214+
208215
if defined __PrintLastResultsOnly (
209216
set __RuntestPyArgs=%__RuntestPyArgs% --analyze_results_only
210217
)

tests/runtest.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
parser.add_argument("--jitdisasm", dest="jitdisasm", action="store_true", default=False)
119119
parser.add_argument("--ilasmroundtrip", dest="ilasmroundtrip", action="store_true", default=False)
120120
parser.add_argument("--run_crossgen_tests", dest="run_crossgen_tests", action="store_true", default=False)
121+
parser.add_argument("--large_version_bubble", dest="large_version_bubble", action="store_true", default=False)
121122
parser.add_argument("--precompile_core_root", dest="precompile_core_root", action="store_true", default=False)
122123
parser.add_argument("--sequential", dest="sequential", action="store_true", default=False)
123124

@@ -761,6 +762,10 @@ def run_tests(host_os,
761762
print("Running tests R2R")
762763
os.environ["RunCrossGen"] = "true"
763764

765+
if large_version_bubble:
766+
print("Large Version Bubble enabled")
767+
os.environ["LargeVersionBubble"] = "true"
768+
764769
if gc_stress:
765770
print("Running GCStress, extending timeout to 120 minutes.")
766771
os.environ["__TestTimeout"] = str(120*60*1000) # 1,800,000 ms
@@ -2047,6 +2052,7 @@ def do_setup(host_os,
20472052
is_ilasm=unprocessed_args.ilasmroundtrip,
20482053
run_sequential=unprocessed_args.sequential,
20492054
run_crossgen_tests=unprocessed_args.run_crossgen_tests,
2055+
large_version_bubble=unprocessed_args.large_version_bubble,
20502056
test_env=test_env)
20512057

20522058
################################################################################

tests/src/CLRTest.CrossGen.targets

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ fi
7575
7676
REM CrossGen Script
7777
if defined RunCrossGen (
78+
if defined LargeVersionBubble ( set OptionalArguments=!OptionalArguments! /largeversionbubble)
7879
set COMPlus_ZapRequire=$(ZapRequire)
7980
set COMPlus_ZapRequireList=$(MSBuildProjectName)
8081
if not exist "$(MSBuildProjectName).org" (
@@ -84,8 +85,8 @@ if defined RunCrossGen (
8485
mkdir IL
8586
copy $(MSBuildProjectName).exe IL\$(MSBuildProjectName).exe
8687
ren $(MSBuildProjectName).exe $(MSBuildProjectName).org
87-
echo "%_DebuggerFullPath% %CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
88-
%_DebuggerFullPath% "%CORE_ROOT%\crossgen.exe" /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
88+
echo "%_DebuggerFullPath% %CORE_ROOT%\crossgen.exe" !OptionalArguments! /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
89+
%_DebuggerFullPath% "%CORE_ROOT%\crossgen.exe" !OptionalArguments! /Platform_Assemblies_Paths %CORE_ROOT%%3B%25cd%25\IL%3B%25cd%25 /in $(MSBuildProjectName).org /out $(MSBuildProjectName).exe
8990
set CrossGenStatus=!ERRORLEVEL!
9091
)
9192
call :ReleaseLock
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Diagnostics;
3+
using System.Runtime.CompilerServices;
4+
5+
public class Helper
6+
{
7+
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
8+
public string GetLastMethodName()
9+
{
10+
StackTrace st = new StackTrace();
11+
return st.GetFrame(0).GetMethod().Name;
12+
}
13+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{F74F55A1-DFCF-4C7C-B462-E96E1D0BB667}</ProjectGuid>
9+
<OutputType>library</OutputType>
10+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
11+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
12+
<DefineConstants>$(DefineConstants);STATIC;CORECLR</DefineConstants>
13+
<CLRTestKind>SharedLibrary</CLRTestKind>
14+
<Optimize>True</Optimize>
15+
</PropertyGroup>
16+
<!-- Default configurations to help VS understand the configurations -->
17+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
18+
</PropertyGroup>
19+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
20+
</PropertyGroup>
21+
<ItemGroup>
22+
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
23+
<Visible>False</Visible>
24+
</CodeAnalysisDependentAssemblyPaths>
25+
</ItemGroup>
26+
<ItemGroup>
27+
<Compile Include=".\helper.cs" />
28+
</ItemGroup>
29+
<ItemGroup>
30+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
31+
</ItemGroup>
32+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
33+
</Project>
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
using System;
2+
3+
public class Program
4+
{
5+
public static int Main()
6+
{
7+
return RunTest();
8+
}
9+
10+
public static int RunTest()
11+
{
12+
Helper helper = new Helper();
13+
string lastMethodName = String.Empty;
14+
try
15+
{
16+
lastMethodName = helper.GetLastMethodName();
17+
}
18+
catch (System.MissingMethodException e)
19+
{
20+
if((System.Environment.GetEnvironmentVariable("LargeVersionBubble") != null))
21+
{
22+
// Cross-Assembly inlining is only allowed in multi-module version bubbles
23+
Console.WriteLine("FAIL");
24+
return 101;
25+
}
26+
else
27+
{
28+
// The missing method is expected in the default crossgen case (i.e. no large version bubble)
29+
Console.WriteLine("PASS");
30+
return 100;
31+
}
32+
}
33+
34+
if (lastMethodName != "GetNumber")
35+
{
36+
// method in helper.cs has been inlined
37+
Console.WriteLine("PASS");
38+
return 100;
39+
}
40+
else
41+
{
42+
Console.WriteLine("FAIL");
43+
return 101;
44+
}
45+
}
46+
}
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{7DECC55A-B584-4456-83BA-6C42A5B3B3CB}</ProjectGuid>
9+
<OutputType>exe</OutputType>
10+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
11+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
12+
<CLRTestKind>BuildAndRun</CLRTestKind>
13+
<DefineConstants>$(DefineConstants);STATIC;CORECLR</DefineConstants>
14+
<ZapRequire>1</ZapRequire>
15+
<CLRTestPriority>1</CLRTestPriority>
16+
<DebugType>PdbOnly</DebugType>
17+
<Optimize>True</Optimize>
18+
</PropertyGroup>
19+
<!-- Default configurations to help VS understand the configurations -->
20+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
21+
</PropertyGroup>
22+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
23+
</PropertyGroup>
24+
<ItemGroup>
25+
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies">
26+
<Visible>False</Visible>
27+
</CodeAnalysisDependentAssemblyPaths>
28+
</ItemGroup>
29+
<ItemGroup>
30+
<ProjectReference Include=".\helper.csproj">
31+
<Project>{F74F55A1-DFCF-4C7C-B462-E96E1D0BB667}</Project>
32+
</ProjectReference>
33+
</ItemGroup>
34+
<ItemGroup>
35+
<Compile Include="versionbubbles.cs" />
36+
</ItemGroup>
37+
<ItemGroup>
38+
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
39+
</ItemGroup>
40+
<PropertyGroup>
41+
<!-- <CLRTestBatchPreCommands><![CDATA[
42+
echo Running CLRTestBatchPreCommands
43+
$(CLRTestBatchPreCommands)
44+
Set COMPLUS_ZAPREQUIRE=1
45+
Set COMPLUS_ZAPREQUIRELIST=helper
46+
set _inputFile=versionbubbles.exe
47+
if exist "versionbubbles.org" (set _inputFile=versionbubbles.org)
48+
%Core_Root%\crossgen /largeversionbubble /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out helper.ni.dll helper.dll
49+
%Core_Root%\crossgen /largeversionbubble /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out versionbubbles.ni.exe %_inputFile%
50+
]]></CLRTestBatchPreCommands>
51+
<BashCLRTestPreCommands><![CDATA[
52+
echo Running BashCLRTestPreCommands
53+
$(BashCLRTestPreCommands)
54+
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out helper.ni.dll helper.dll
55+
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out versionbubbles.ni.exe versionbubbles.exe
56+
]]></BashCLRTestPreCommands> -->
57+
</PropertyGroup>
58+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
59+
</Project>

0 commit comments

Comments
 (0)