-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Enable basic Kept validation in NativeAOT running linker tests #78828
Changes from 7 commits
86aa062
308da87
ca7f956
1076b77
c6ccc5e
b5b8aa4
466cf74
748cdd1
566656f
d482725
26bdb3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,11 @@ namespace Mono.Linker.Tests.Cases.Expectations.Assertions | |
[AttributeUsage (AttributeTargets.All, Inherited = false)] | ||
public class KeptAttribute : BaseExpectedLinkedBehaviorAttribute | ||
{ | ||
/// <summary> | ||
/// By default the target should be kept by all platforms | ||
/// This property can override that by setting only the platforms | ||
/// which are expected to keep the target. | ||
/// </summary> | ||
public ProducedBy KeptBy { get; set; } = ProducedBy.TrimmerAnalyzerAndNativeAot; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: kind of weird name to repeat the name of the attribute on the property. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So just |
||
} | ||
} |
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.
I'll just assume the changes here match what IL Linker is doing. But for the
??
part I want to point out that we would only take that codepath for array constructors (so e.g.new int[10, 20, 30];
) and whether that part is intentional.If so, I'd suggest we change the if above to
if (method.IsConstructor && method.OwningType is DefType defType)
. Array constructors will fall down to the lastif
in the cascade.