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.
Do not assume return type ABIs match in
RETURN(CALL)
(dotnet#72285)
* Do not assume calling conventions match When importing GT_RETURN. * Add a test * Disable the test on Mono
- Loading branch information
1 parent
cf7685b
commit 8c6c5ad
Showing
4 changed files
with
45 additions
and
1 deletion.
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
31 changes: 31 additions & 0 deletions
31
src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.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,31 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
unsafe class Runtime_72265 | ||
{ | ||
private static int Main() | ||
{ | ||
var unmanaged = ((delegate* unmanaged<StructWithIndex>)&GetStructUnmanaged)(); | ||
var managed = GetStructManaged(); | ||
|
||
return !unmanaged.Equals(managed) ? 101 : 100; | ||
} | ||
|
||
[UnmanagedCallersOnly] | ||
private static StructWithIndex GetStructUnmanaged() | ||
{ | ||
return GetStructManaged(); | ||
} | ||
|
||
[MethodImpl(MethodImplOptions.NoInlining)] | ||
static StructWithIndex GetStructManaged() => new StructWithIndex { Index = 10, Value = 11 }; | ||
|
||
struct StructWithIndex | ||
{ | ||
public int Index; | ||
public int Value; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/tests/JIT/Regression/JitBlue/Runtime_72265/Runtime_72265.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,10 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<Optimize>True</Optimize> | ||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |
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