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

UnusedFieldsOfTypesAreNotRemoved.cs « InternalCalls « Interop « Mono.Linker.Tests.Cases « Tests « linker - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 09809a60ee44907fc2995f8a6d07726199bb2c9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
using System.Runtime.CompilerServices;
using Mono.Linker.Tests.Cases.Expectations.Assertions;

namespace Mono.Linker.Tests.Cases.Interop.InternalCalls {
	class UnusedFieldsOfTypesAreNotRemoved {
		public static void Main ()
		{
			var a = new A ();
			SomeMethod (a);
		}

		[KeptMember (".ctor()")]
		class A {
			[Kept] private int field1;

			[Kept] private int field2;
		}

		[Kept]
		[MethodImpl (MethodImplOptions.InternalCall)]
		static extern void SomeMethod (A a);
	}
}