This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
208 additions
and
44 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Runtime.CompilerServices; | ||
|
||
public class Helper | ||
{ | ||
[MethodImplAttribute(MethodImplOptions.AggressiveInlining)] | ||
public string GetLastMethodName() | ||
{ | ||
StackTrace st = new StackTrace(); | ||
return st.GetFrame(0).GetMethod().Name; | ||
} | ||
} |
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,33 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{F74F55A1-DFCF-4C7C-B462-E96E1D0BB667}</ProjectGuid> | ||
<OutputType>library</OutputType> | ||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir> | ||
<DefineConstants>$(DefineConstants);STATIC;CORECLR</DefineConstants> | ||
<CLRTestKind>SharedLibrary</CLRTestKind> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<!-- Default configurations to help VS understand the configurations --> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> | ||
<Visible>False</Visible> | ||
</CodeAnalysisDependentAssemblyPaths> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include=".\helper.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> | ||
</ItemGroup> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> | ||
</Project> |
46 changes: 46 additions & 0 deletions
46
tests/src/readytorun/tests/versionbubbles/versionbubbles.cs
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,46 @@ | ||
using System; | ||
|
||
public class Program | ||
{ | ||
public static int Main() | ||
{ | ||
return RunTest(); | ||
} | ||
|
||
public static int RunTest() | ||
{ | ||
Helper helper = new Helper(); | ||
string lastMethodName = String.Empty; | ||
try | ||
{ | ||
lastMethodName = helper.GetLastMethodName(); | ||
} | ||
catch (System.MissingMethodException e) | ||
{ | ||
if((System.Environment.GetEnvironmentVariable("LargeVersionBubble") != null)) | ||
{ | ||
// Cross-Assembly inlining is only allowed in multi-module version bubbles | ||
Console.WriteLine("FAIL"); | ||
return 101; | ||
} | ||
else | ||
{ | ||
// The missing method is expected in the default crossgen case (i.e. no large version bubble) | ||
Console.WriteLine("PASS"); | ||
return 100; | ||
} | ||
} | ||
|
||
if (lastMethodName != "GetNumber") | ||
{ | ||
// method in helper.cs has been inlined | ||
Console.WriteLine("PASS"); | ||
return 100; | ||
} | ||
else | ||
{ | ||
Console.WriteLine("FAIL"); | ||
return 101; | ||
} | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
tests/src/readytorun/tests/versionbubbles/versionbubbles.csproj
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,59 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{7DECC55A-B584-4456-83BA-6C42A5B3B3CB}</ProjectGuid> | ||
<OutputType>exe</OutputType> | ||
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir> | ||
<CLRTestKind>BuildAndRun</CLRTestKind> | ||
<DefineConstants>$(DefineConstants);STATIC;CORECLR</DefineConstants> | ||
<ZapRequire>1</ZapRequire> | ||
<CLRTestPriority>1</CLRTestPriority> | ||
<DebugType>PdbOnly</DebugType> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<!-- Default configurations to help VS understand the configurations --> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<CodeAnalysisDependentAssemblyPaths Condition=" '$(VS100COMNTOOLS)' != '' " Include="$(VS100COMNTOOLS)..\IDE\PrivateAssemblies"> | ||
<Visible>False</Visible> | ||
</CodeAnalysisDependentAssemblyPaths> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include=".\helper.csproj"> | ||
<Project>{F74F55A1-DFCF-4C7C-B462-E96E1D0BB667}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="versionbubbles.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<!-- <CLRTestBatchPreCommands><![CDATA[ | ||
echo Running CLRTestBatchPreCommands | ||
$(CLRTestBatchPreCommands) | ||
Set COMPLUS_ZAPREQUIRE=1 | ||
Set COMPLUS_ZAPREQUIRELIST=helper | ||
set _inputFile=versionbubbles.exe | ||
if exist "versionbubbles.org" (set _inputFile=versionbubbles.org) | ||
%Core_Root%\crossgen /largeversionbubble /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out helper.ni.dll helper.dll | ||
%Core_Root%\crossgen /largeversionbubble /readytorun /platform_assemblies_paths %Core_Root%%3B%25CD% /out versionbubbles.ni.exe %_inputFile% | ||
]]></CLRTestBatchPreCommands> | ||
<BashCLRTestPreCommands><![CDATA[ | ||
echo Running BashCLRTestPreCommands | ||
$(BashCLRTestPreCommands) | ||
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out helper.ni.dll helper.dll | ||
$CORE_ROOT/crossgen -readytorun -platform_assemblies_paths $CORE_ROOT:`pwd` -out versionbubbles.ni.exe versionbubbles.exe | ||
]]></BashCLRTestPreCommands> --> | ||
</PropertyGroup> | ||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" /> | ||
</Project> |