Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/tests/CoreMangLib/system/delegate/VSD/OpenDelegate.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Collections.Generic;
using Xunit;
Expand All @@ -13,7 +14,7 @@ public class ClassA
}

public delegate int Delegate_TC_Int(ClassA tc);
public static MethodInfo GetMethod(Type t, string method)
public static MethodInfo GetMethod([DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.PublicMethods)] Type t, string method)
{
TypeInfo typeInfo = t.GetTypeInfo();
IEnumerator<MethodInfo> enumerator = typeInfo.DeclaredMethods.GetEnumerator();
Expand Down
14 changes: 0 additions & 14 deletions src/tests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,6 @@
<!-- IL projects often have mismatches assembly names vs file names and that breaks Win32 resource generation option -->
<IlcGenerateWin32Resources Condition="'$(Language)' == 'IL'">false</IlcGenerateWin32Resources>

<!-- The default TrimMode in the SDK is full. But trimming most of the tests would just make them fail,
so the default for the test tree is partial. -->
<TrimMode Condition="'$(EnableAggressiveTrimming)' != 'true'">partial</TrimMode>

<IlcTreatWarningsAsErrors>false</IlcTreatWarningsAsErrors>

<IlcToolsPath>$(CoreCLRCrossILCompilerDir)</IlcToolsPath>
Expand All @@ -561,16 +557,6 @@
<!-- Bump the generic cycle tolerance. There's at least one test with a cycle that is reachable at runtime to depth 6 -->
<IlcArg Include="--maxgenericcycle:7" />

<!-- We set TrimMode to partial so that we don't trim parts of the tests,
but don't make this apply to xunit cruft -->
<IlcArg Include="--trim:Microsoft.DotNet.XUnitExtensions" />
<IlcArg Include="--trim:xunit.abstractions" />
<IlcArg Include="--trim:xunit.assert" />
<IlcArg Include="--trim:xunit.console" />
<IlcArg Include="--trim:xunit.core" />
<IlcArg Include="--trim:xunit.execution.dotnet" />
<IlcArg Include="--trim:xunit.abstractions" />

<!-- NativeAOT compiled output is placed into a 'native' subdirectory: we need to set
rpath so that the test can load its native library dependencies if there's any -->
<LinkerArg Include="-Wl,-rpath,'@executable_path/..'" Condition="'$(SetIlcRPath)' != 'false' and ('$(TargetOS)' == 'osx' or '$(TargetsAppleMobile)' == 'true')" />
Expand Down
22 changes: 12 additions & 10 deletions src/tests/JIT/Directed/forceinlining/AttributeConflict.il
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
.ver 4:0:0:0
}

.assembly extern System.Diagnostics.StackTrace { }

.assembly AttributeConflict
{
}
Expand Down Expand Up @@ -160,8 +162,8 @@
IL_00c7: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_00cc: ldc.i4.0
IL_00cd: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_00d2: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_00d7: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_00d2: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_00d7: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_00dc: stloc.0
IL_00dd: ldloc.0
IL_00de: ldstr "A1"
Expand Down Expand Up @@ -308,8 +310,8 @@
IL_00c7: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_00cc: ldc.i4.0
IL_00cd: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_00d2: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_00d7: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_00d2: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_00d7: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_00dc: stloc.0
IL_00dd: ldloc.0
IL_00de: ldstr "A2"
Expand Down Expand Up @@ -456,8 +458,8 @@
IL_00c7: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_00cc: ldc.i4.0
IL_00cd: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_00d2: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_00d7: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_00d2: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_00d7: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_00dc: stloc.0
IL_00dd: ldloc.0
IL_00de: ldstr "A3"
Expand Down Expand Up @@ -604,8 +606,8 @@
IL_00c7: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_00cc: ldc.i4.0
IL_00cd: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_00d2: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_00d7: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_00d2: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_00d7: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_00dc: stloc.0
IL_00dd: ldloc.0
IL_00de: ldstr "A4"
Expand Down Expand Up @@ -634,8 +636,8 @@
IL_000e: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_0013: ldc.i4.0
IL_0014: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_0019: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_001e: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_0019: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_001e: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_0023: stloc.0
IL_0024: ldloc.0
IL_0025: ldstr "A5"
Expand Down
6 changes: 4 additions & 2 deletions src/tests/JIT/Directed/forceinlining/NegativeCases.il
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
.ver 4:0:0:0
}

.assembly extern System.Diagnostics.StackTrace { }

.assembly NegativeCases
{
}
Expand All @@ -34,8 +36,8 @@
IL_0001: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_0006: ldc.i4.0
IL_0007: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_000c: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_0011: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_000c: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_0011: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_0016: stloc.0
.try
{
Expand Down
18 changes: 10 additions & 8 deletions src/tests/JIT/Directed/forceinlining/PositiveCases.il
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
.ver 4:0:0:0
}

.assembly extern System.Diagnostics.StackTrace { }

.assembly PositiveCases
{
}
Expand Down Expand Up @@ -178,8 +180,8 @@
IL_00c7: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_00cc: ldc.i4.0
IL_00cd: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_00d2: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_00d7: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_00d2: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_00d7: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_00dc: stloc.0
IL_00dd: ldloc.0
IL_00de: ldstr "A1"
Expand Down Expand Up @@ -326,8 +328,8 @@
IL_00c7: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_00cc: ldc.i4.0
IL_00cd: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_00d2: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_00d7: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_00d2: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_00d7: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_00dc: stloc.0
IL_00dd: ldloc.0
IL_00de: ldstr "A2"
Expand All @@ -354,8 +356,8 @@
IL_000d: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_0012: ldc.i4.0
IL_0013: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_0018: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_001d: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_0018: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_001d: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_0022: stloc.0
IL_0023: ldloc.0
IL_0024: ldstr "A3"
Expand All @@ -382,8 +384,8 @@
IL_000d: newobj instance void [mscorlib]System.Diagnostics.StackTrace::.ctor()
IL_0012: ldc.i4.0
IL_0013: callvirt instance class [mscorlib]System.Diagnostics.StackFrame [mscorlib]System.Diagnostics.StackTrace::GetFrame(int32)
IL_0018: callvirt instance class [mscorlib]System.Reflection.MethodBase [mscorlib]System.Diagnostics.StackFrame::GetMethod()
IL_001d: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name()
IL_0018: call class [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::Create(class [mscorlib]System.Diagnostics.StackFrame)
IL_001d: callvirt instance string [System.Diagnostics.StackTrace]System.Diagnostics.DiagnosticMethodInfo::get_Name()
IL_0022: stloc.0
IL_0023: ldloc.0
IL_0024: ldstr "A4"
Expand Down
37 changes: 19 additions & 18 deletions src/tests/JIT/Generics/ConstrainedCall/class1.il
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.ver 4:0:0:0
}
.assembly extern xunit.core {}
.assembly extern mscorlib {}
.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) }
.assembly ASSEMBLY_NAME {}
.class interface private abstract auto ansi IncrDecr
{
Expand All @@ -30,7 +30,7 @@
}

.class private auto ansi beforefieldinit MyInt
extends [mscorlib]System.Object
extends [System.Runtime]System.Object
implements IncrDecr
{
.field private int32 x
Expand Down Expand Up @@ -79,17 +79,18 @@
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0001: call instance void [System.Runtime]System.Object::.ctor()
IL_0006: ret
}

}

.class private auto ansi beforefieldinit MyCounter<(IncrDecr) T>
extends [mscorlib]System.Object
extends [System.Runtime]System.Object
{
.param type T
.custom instance void [mscorlib]System.Runtime.CompilerServices.NewConstraintAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [System.Runtime]System.Runtime.CompilerServices.NewConstraintAttribute::.ctor() = ( 01 00 00 00 )
.custom instance void [System.Runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMembersAttribute::.ctor(valuetype [System.Runtime]System.Diagnostics.CodeAnalysis.DynamicallyAccessedMemberTypes) = ( 01 00 01 00 00 00 00 00 )
.field private !T counter
.field private !T[] counters
.method public hidebysig instance void
Expand Down Expand Up @@ -126,8 +127,8 @@
IL_0001: ldfld !0[] class MyCounter<!T>::counters
IL_0006: ldarg.1
IL_0007: ldtoken !T
IL_000c: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_0011: call object [mscorlib]System.Activator::CreateInstance(class [mscorlib]System.Type)
IL_000c: call class [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle(valuetype [System.Runtime]System.RuntimeTypeHandle)
IL_0011: call object [System.Runtime]System.Activator::CreateInstance(class [System.Runtime]System.Type)
IL_0016: unbox.any !T
IL_001b: stelem !T
IL_0020: ldarg.0
Expand Down Expand Up @@ -226,23 +227,23 @@
.maxstack 8
IL_0000: ldarg.0
IL_0001: ldtoken !T
IL_0006: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle)
IL_000b: call object [mscorlib]System.Activator::CreateInstance(class [mscorlib]System.Type)
IL_0006: call class [System.Runtime]System.Type [System.Runtime]System.Type::GetTypeFromHandle(valuetype [System.Runtime]System.RuntimeTypeHandle)
IL_000b: call object [System.Runtime]System.Activator::CreateInstance(class [System.Runtime]System.Type)
IL_0010: unbox.any !T
IL_0015: stfld !0 class MyCounter<!T>::counter
IL_001a: ldarg.0
IL_001b: ldc.i4.1
IL_001c: newarr !T
IL_0021: stfld !0[] class MyCounter<!T>::counters
IL_0026: ldarg.0
IL_0027: call instance void [mscorlib]System.Object::.ctor()
IL_0027: call instance void [System.Runtime]System.Object::.ctor()
IL_002c: ret
}

}

.class public auto ansi beforefieldinit test
extends [mscorlib]System.Object
extends [System.Runtime]System.Object
{
.method public hidebysig static int32 Main() cil managed
{
Expand All @@ -268,7 +269,7 @@
IL_0020: ldstr "Expected: 100, Actual: {0}"
IL_0025: ldloc.0
IL_0026: callvirt instance int32 class MyCounter<class MyInt>::Val()
IL_002b: box [mscorlib]System.Int32
IL_002b: box [System.Runtime]System.Int32
IL_0030: call void [System.Console]System.Console::WriteLine(string,
object)
IL_0035: ldc.i4.1
Expand All @@ -286,7 +287,7 @@
IL_0054: ldstr "Expected: 100, Actual: {0}"
IL_0059: ldloc.0
IL_005a: callvirt instance int32 class MyCounter<class MyInt>::Val()
IL_005f: box [mscorlib]System.Int32
IL_005f: box [System.Runtime]System.Int32
IL_0064: call void [System.Console]System.Console::WriteLine(string,
object)
IL_0069: ldc.i4.2
Expand All @@ -308,7 +309,7 @@
IL_0091: ldloc.0
IL_0092: ldc.i4.0
IL_0093: callvirt instance int32 class MyCounter<class MyInt>::Val(int32)
IL_0098: box [mscorlib]System.Int32
IL_0098: box [System.Runtime]System.Int32
IL_009d: call void [System.Console]System.Console::WriteLine(string,
object)
IL_00a2: ldc.i4.3
Expand All @@ -329,7 +330,7 @@
IL_00c8: ldloc.0
IL_00c9: ldc.i4.0
IL_00ca: callvirt instance int32 class MyCounter<class MyInt>::Val(int32)
IL_00cf: box [mscorlib]System.Int32
IL_00cf: box [System.Runtime]System.Int32
IL_00d4: call void [System.Console]System.Console::WriteLine(string,
object)
IL_00d9: ldc.i4.4
Expand All @@ -351,7 +352,7 @@
IL_00fe: ldstr "Expected: 100, Actual: {0}"
IL_0103: ldloc.0
IL_0104: callvirt instance int32 class MyCounter<class MyInt>::Val()
IL_0109: box [mscorlib]System.Int32
IL_0109: box [System.Runtime]System.Int32
IL_010e: call void [System.Console]System.Console::WriteLine(string,
object)
IL_0113: ldc.i4.5
Expand All @@ -370,7 +371,7 @@
IL_0130: ldstr "Expected: 100, Actual: {0}"
IL_0135: ldloc.0
IL_0136: callvirt instance int32 class MyCounter<class MyInt>::Val()
IL_013b: box [mscorlib]System.Int32
IL_013b: box [System.Runtime]System.Int32
IL_0140: call void [System.Console]System.Console::WriteLine(string,
object)
IL_0145: ldc.i4.6
Expand All @@ -392,7 +393,7 @@
{
.maxstack 8
IL_0000: ldarg.0
IL_0001: call instance void [mscorlib]System.Object::.ctor()
IL_0001: call instance void [System.Runtime]System.Object::.ctor()
IL_0006: ret
}
}
Loading
Loading