-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Instance method bodies do not need to be marked until an instance of the type could exist. * Add MethodConvertedToThrow callback * Update link xml preserve test expected behavior
- Loading branch information
Showing
55 changed files
with
1,586 additions
and
61 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
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
75 changes: 75 additions & 0 deletions
75
test/Mono.Linker.Tests.Cases/BCLFeatures/ETW/BaseRemovedEventSourceEmptyBody.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,75 @@ | ||
using System.Diagnostics.Tracing; | ||
using Mono.Linker.Tests.Cases.Expectations.Assertions; | ||
using Mono.Linker.Tests.Cases.Expectations.Metadata; | ||
|
||
namespace Mono.Linker.Tests.Cases.BCLFeatures.ETW { | ||
[SetupLinkerArgument ("--exclude-feature", "etw")] | ||
public class BaseRemovedEventSourceEmptyBody { | ||
public static void Main () | ||
{ | ||
var b = CustomCtorEventSourceEmptyBody.Log.IsEnabled (); | ||
if (b) | ||
CustomCtorEventSourceEmptyBody.Log.SomeMethod (); | ||
} | ||
} | ||
|
||
[Kept] | ||
[KeptBaseType (typeof (EventSource))] | ||
[KeptMember (".ctor()")] | ||
[KeptMember (".cctor()")] | ||
[EventSource (Name = "MyCompany")] | ||
class CustomCtorEventSourceEmptyBody : EventSource { | ||
public class Keywords { | ||
public const EventKeywords Page = (EventKeywords)1; | ||
|
||
public int Unused; | ||
} | ||
|
||
[Kept] | ||
public static CustomCtorEventSourceEmptyBody Log = new MyEventSourceBasedOnCustomCtorEventSourceEmptyBody (1); | ||
|
||
[Kept] | ||
[ExpectedInstructionSequence (new [] | ||
{ | ||
"ldarg.0", | ||
"call", | ||
"ret", | ||
})] | ||
public CustomCtorEventSourceEmptyBody (int value) | ||
{ | ||
Removed (); | ||
} | ||
|
||
[Kept] | ||
protected override void OnEventCommand (EventCommandEventArgs command) | ||
{ | ||
// Not converted to throw because the body is empty | ||
} | ||
|
||
[Kept] | ||
[ExpectedInstructionSequence (new [] | ||
{ | ||
"ldstr", | ||
"newobj", | ||
"throw", | ||
})] | ||
[Event (8)] | ||
public void SomeMethod () | ||
{ | ||
Removed (); | ||
} | ||
|
||
public void Removed () | ||
{ | ||
} | ||
} | ||
|
||
[Kept] | ||
[KeptBaseType (typeof (CustomCtorEventSourceEmptyBody))] | ||
class MyEventSourceBasedOnCustomCtorEventSourceEmptyBody : CustomCtorEventSourceEmptyBody { | ||
[Kept] | ||
public MyEventSourceBasedOnCustomCtorEventSourceEmptyBody (int value) : base (value) | ||
{ | ||
} | ||
} | ||
} |
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
Oops, something went wrong.