-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Mono AOT] Fix error when returning zero sized struct (#106013)
* Fix error when returning zero sized struct * Add test * Fix x64 errors
- Loading branch information
Showing
3 changed files
with
46 additions
and
2 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
29 changes: 29 additions & 0 deletions
29
src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.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,29 @@ | ||
// 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.InteropServices; | ||
using Xunit; | ||
|
||
[StructLayout(LayoutKind.Sequential)] | ||
public struct S1 | ||
{ | ||
} | ||
|
||
[StructLayout(LayoutKind.Auto)] | ||
public struct S2 | ||
{ | ||
} | ||
|
||
public class Runtime_103628 | ||
{ | ||
public static S1 Get_S1() => new S1(); | ||
|
||
public static S2 Get_S2() => new S2(); | ||
|
||
[Fact] | ||
public static void TestEntryPoint() | ||
{ | ||
S1 s1 = Get_S1(); | ||
S2 s2 = Get_S2(); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/tests/JIT/Regression/JitBlue/Runtime_103628/Runtime_103628.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,8 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Optimize>True</Optimize> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |