-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mono] Extend mono_gsharedvt_constrained_call JIT icall to handle static virtual methods #90875
Merged
kotlarmilos
merged 5 commits into
dotnet:main
from
kotlarmilos:bugfix/static-virtual-methods
Aug 24, 2023
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ca10ab9
Extend mono_gsharedvt_constrained_call JIT icall to handle static vir…
kotlarmilos 1cdf446
Handle static virtual calls in constrained_gsharedvt_call_setup
kotlarmilos 1b33633
Fix lint
kotlarmilos ed9c472
Add runtime test
kotlarmilos f09cd15
Remove runtime test
kotlarmilos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
47 changes: 47 additions & 0 deletions
47
src/tests/JIT/Generics/ConstrainedCall/static_virtual_calls.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,47 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
|
||
using System; | ||
using Xunit; | ||
|
||
|
||
public interface ITypeChecker | ||
{ | ||
static abstract bool Test<T>(); | ||
} | ||
|
||
public interface IHandler | ||
{ | ||
bool Test<T>(); | ||
} | ||
|
||
public class TypeChecker : ITypeChecker | ||
{ | ||
public static bool Test<T>() => true; | ||
} | ||
|
||
public class Handler<TChecker> : IHandler where TChecker : ITypeChecker | ||
{ | ||
public bool Test<T>() => TChecker.Test<T>(); | ||
} | ||
|
||
public class test | ||
{ | ||
[Fact] | ||
public static int TestEntryPoint() | ||
{ | ||
var handler = GetHandler(); | ||
bool test = handler.Test<int>(); | ||
if (test) { | ||
Console.WriteLine("PASSED"); | ||
return 100; | ||
} | ||
|
||
Console.WriteLine("FAILED"); | ||
return 101; | ||
} | ||
|
||
public static IHandler GetHandler() => new Handler<TypeChecker>(); | ||
} | ||
|
5 changes: 5 additions & 0 deletions
5
src/tests/JIT/Generics/ConstrainedCall/static_virtual_calls.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,5 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<ItemGroup> | ||
<Compile Include="$(MSBuildProjectName).cs" /> | ||
</ItemGroup> | ||
</Project> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test seems quite trivial. Would it even fail on CI ? Or is the failure dependent on compilation flags that we don't use on CI.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue occurred in full AOT mode only. This test is used locally to reproduce and fix the issue, which is similar to the customer reported issue. Do you think it should be expanded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you disable your fix will this test fail on CI currently ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before adding a new test, we should verify if it is not already covered on the CI. This will be done once the AOT job is fixed. The customer issue won't be closed until we verify that this case has test coverage.