-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for invalid trim annotations in top-level method (#103182)
Adds a testcase for #101215.
- Loading branch information
Showing
7 changed files
with
41 additions
and
6 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
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
1 change: 1 addition & 0 deletions
1
...t/Mono.Linker.Tests.Cases/TopLevelStatements/InvalidAnnotations/InvalidAnnotations.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 @@ | ||
<Project Sdk="Microsoft.NET.Sdk" /> |
28 changes: 28 additions & 0 deletions
28
...ools/illink/test/Mono.Linker.Tests.Cases/TopLevelStatements/InvalidAnnotations/Program.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,28 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. | ||
// Licensed under the MIT license. See LICENSE file in the project root for full license information. | ||
|
||
using System.Diagnostics.CodeAnalysis; | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
|
||
[assembly: ExpectedNoWarnings] | ||
|
||
Test (); | ||
|
||
[UnexpectedWarning ("IL2072", Tool.Analyzer, "https://github.com/dotnet/runtime/issues/101211")] | ||
[Kept] | ||
static void Test () { | ||
RequireAll (GetUnsupportedType ()); | ||
} | ||
|
||
[ExpectedWarning ("IL2098", Tool.Trimmer | Tool.NativeAot, "https://github.com/dotnet/runtime/issues/101215")] | ||
[Kept] | ||
static void RequireAll( | ||
[KeptAttributeAttribute (typeof (DynamicallyAccessedMembersAttribute))] | ||
[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.All)] UnsupportedType f) {} | ||
|
||
[Kept] | ||
static UnsupportedType GetUnsupportedType () => new UnsupportedType (); | ||
|
||
[Kept] | ||
[KeptMember (".ctor()")] | ||
class UnsupportedType {} |