Welcome to mirror list, hosted at ThFree Co, Russian Federation.

WarningsAreSorted.cs « Individual « Warnings « Mono.Linker.Tests.Cases « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c39f6a9028ce5343cf7590e64c9b8719ebea07dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// 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;
using System.Diagnostics.CodeAnalysis;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;
using Mono.Linker.Tests.Cases.Warnings.Dependencies;


namespace Mono.Linker.Tests.Cases.Warnings.Individual
{
	[SkipRemainingErrorsValidation]
	[SetupLinkerTrimMode ("skip")]
#if !NETCOREAPP
	[SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) }, new[] { "System.Core.dll" })]
#else
	[SetupCompileBefore ("library.dll", new[] { typeof (TriggerWarnings_Lib) })]
#endif
	[KeptAssembly ("library.dll")]
	[SetupLinkerAction ("link", "library.dll")]
	[SetupLinkerArgument ("--verbose")]
	public class WarningsAreSorted
	{
		public static void Main ()
		{
			TriggerWarnings_Lib.Main ();
			B.Z ();
			B.Y ();
			B.X ();
			A.Y ();
			A.X ();
		}

		public static class Warn
		{
			[DynamicallyAccessedMembers (DynamicallyAccessedMemberTypes.PublicFields)]
			public static string _;
		}

		public class A
		{
			public static void X ()
			{
				_ = Type.GetType (Warn._).GetMethod ("None");
			}

			public static void Y ()
			{
				_ = Type.GetType (Warn._).GetMethod ("None");
			}
		}

		public class B
		{
			public static void X ()
			{
				_ = Type.GetType (Warn._).GetMethod ("None");
			}

			public static void Y ()
			{
				_ = Type.GetType (Warn._).GetMethod ("None");
			}

			public static void Z ()
			{
				_ = Type.GetType (Warn._).GetMethod ("None");
			}
		}
	}
}