forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow widening for explicit tailcalls (dotnet#55989)
It is a runtime detail that the managed calling convention widens return values, so only allow this behavior for opportunistic tailcalls. Fix dotnet#55253
- Loading branch information
1 parent
1a84b29
commit 94a8430
Showing
7 changed files
with
89 additions
and
14 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
3 changes: 3 additions & 0 deletions
3
src/tests/JIT/Regression/JitBlue/Runtime_54842/Runtime_54842.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
3 changes: 3 additions & 0 deletions
3
src/tests/JIT/Regression/JitBlue/Runtime_55140/Runtime_55140.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
24 changes: 24 additions & 0 deletions
24
src/tests/JIT/Regression/JitBlue/Runtime_55253/Runtime_55253.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,24 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
class Runtime_55253 | ||
{ | ||
static int Main() | ||
{ | ||
int errors = 0; | ||
if (AsInt32() != -1) | ||
errors |= 1; | ||
if (AsUInt32() != 255) | ||
errors |= 2; | ||
|
||
return 100 + errors; | ||
} | ||
|
||
static uint AsUInt32() => AsUInt16(); | ||
static uint AsUInt16() => AsUInt8(); | ||
static uint AsUInt8() => 255; | ||
|
||
static int AsInt32() => AsInt16(); | ||
static short AsInt16() => AsInt8(); | ||
static sbyte AsInt8() => -1; | ||
} |
22 changes: 22 additions & 0 deletions
22
src/tests/JIT/Regression/JitBlue/Runtime_55253/Runtime_55253.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,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
</PropertyGroup> | ||
<PropertyGroup> | ||
<DebugType>None</DebugType> | ||
<Optimize>False</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<CLRTestBatchPreCommands><![CDATA[ | ||
$(CLRTestBatchPreCommands) | ||
set DOTNET_TailcallStress=1 | ||
]]></CLRTestBatchPreCommands> | ||
<BashCLRTestPreCommands><![CDATA[ | ||
$(BashCLRTestPreCommands) | ||
export DOTNET_TailcallStress=1 | ||
]]></BashCLRTestPreCommands> | ||
</PropertyGroup> | ||
</Project> |