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

WorksWithDynamicAssembly.cs « UnreachableBlock « Mono.Linker.Tests.Cases « test - github.com/mono/linker.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2b33fd2d3788513fa915d77b7a80db2b617ae58d (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
using System.Diagnostics.CodeAnalysis;
using Mono.Linker.Tests.Cases.Expectations.Assertions;
using Mono.Linker.Tests.Cases.Expectations.Metadata;

namespace Mono.Linker.Tests.Cases.UnreachableBlock
{
	[SetupCSharpCompilerToUse ("csc")]
	[SetupCompileArgument ("/optimize+")]
	[SetupLinkerArgument ("--enable-opt", "ipconstprop")]
	[SetupCompileBefore ("library.dll", new string[] { "Dependencies/ReferencedAssemblyWithUnreachableBlocks.cs" },
		addAsReference: false, additionalArguments: "/optimize+", compilerToUse: "csc")]
	[RemovedMemberInAssembly ("library.dll", "Mono.Linker.Tests.Cases.UnreachableBlock.Dependencies.AssemblyWithUnreachableBlocks",
		new string[] { "NeverReached()" })]
	[ExpectedInstructionSequenceOnMemberInAssembly ("library.dll",
		"Mono.Linker.Tests.Cases.UnreachableBlock.Dependencies.AssemblyWithUnreachableBlocks",
		"TestProperty()",
		new string[] {
			"ldc.i4.0",
			"brfalse.s il_3",
			"ret",
		})]
	[Kept]
	public class WorksWithDynamicAssembly
	{
		public static void Main ()
		{
			DependOnAssemblyWithUnreachableBlocks ();
		}

		[Kept]
		[DynamicDependency ("#ctor()", "Mono.Linker.Tests.Cases.UnreachableBlock.Dependencies.AssemblyWithUnreachableBlocks", "library")]
		static void DependOnAssemblyWithUnreachableBlocks () { }
	}
}