Skip to content

Commit 153dca6

Browse files
authored
Exclude SVM test generators from test build (#15)
* Exclude SVM test generators from test build As the two test generators for TypeHierarchy and GenericContext reside within the test source tree, we need to explicitly exclude them from building as part of the test projects, otherwise test project build fails due to asset path mismatches. An alternative option would be to put the two test generator projects under src\tests\Common where other test-related utilites reside and which is globally excluded from test build. Thanks Tomas P.S. I plan to create a no-merge PR against runtime main to get initial CI results for the SVM test cases; locally I see just a handful of failures in the negative tests. * Fix for the MethodFlags negative test * Fix Linux / OSX builds by adding parentheses to logical condition * Fix JIT source code formatting
1 parent cc03608 commit 153dca6

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/coreclr/jit/importer.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13862,8 +13862,7 @@ void Compiler::impImportBlockCode(BasicBlock* block)
1386213862

1386313863
JITDUMP(" %08X", resolvedToken.token);
1386413864

13865-
eeGetCallInfo(&resolvedToken,
13866-
(prefixFlags & PREFIX_CONSTRAINED) ? &constrainedResolvedToken : nullptr,
13865+
eeGetCallInfo(&resolvedToken, (prefixFlags & PREFIX_CONSTRAINED) ? &constrainedResolvedToken : nullptr,
1386713866
addVerifyFlag(combine(CORINFO_CALLINFO_SECURITYCHECKS, CORINFO_CALLINFO_LDFTN)),
1386813867
&callInfo);
1386913868

src/coreclr/vm/jitinterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8680,9 +8680,9 @@ CEEInfo::getMethodSigInternal(
86808680
// Otherwise we would end up with two secret generic dictionary arguments (since the stub also provides one).
86818681
//
86828682
BOOL isCallSiteThatGoesThroughInstantiatingStub =
8683-
signatureKind == SK_VIRTUAL_CALLSITE &&
8683+
(signatureKind == SK_VIRTUAL_CALLSITE &&
86848684
!ftn->IsStatic() &&
8685-
ftn->GetMethodTable()->IsInterface() ||
8685+
ftn->GetMethodTable()->IsInterface()) ||
86868686
signatureKind == SK_STATIC_VIRTUAL_CODEPOINTER_CALLSITE;
86878687
if (!isCallSiteThatGoesThroughInstantiatingStub)
86888688
sigRet->callConv = (CorInfoCallConv) (sigRet->callConv | CORINFO_CALLCONV_PARAMTYPE);

src/coreclr/vm/methodtablebuilder.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5037,10 +5037,13 @@ MethodTableBuilder::ValidateMethods()
50375037
}
50385038
}
50395039

5040-
// Virtual static methods are not allowed.
5041-
if (IsMdStatic(it.Attrs()) && IsMdVirtual(it.Attrs()) && !IsInterface())
5040+
// Virtual static methods are only allowed on interfaces and they must be abstract.
5041+
if (IsMdStatic(it.Attrs()) && IsMdVirtual(it.Attrs()))
50425042
{
5043-
BuildMethodTableThrowException(IDS_CLASSLOAD_STATICVIRTUAL, it.Token());
5043+
if (!IsInterface() || !IsMdAbstract(it.Attrs()))
5044+
{
5045+
BuildMethodTableThrowException(IDS_CLASSLOAD_STATICVIRTUAL, it.Token());
5046+
}
50445047
}
50455048
}
50465049
}

src/tests/Common/dirs.proj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
<DisabledProjects Include="$(TestRoot)GC\Performance\Framework\GCPerfTestFramework.csproj" />
1515
<DisabledProjects Include="$(TestRoot)Loader\classloader\generics\regressions\DD117522\Test.csproj" />
1616
<DisabledProjects Include="$(TestRoot)Loader\classloader\generics\GenericMethods\VSW491668.csproj" /> <!-- issue 5501 -->
17+
<DisabledProjects Include="$(TestRoot)Loader\classloader\StaticVirtualMethods\**\generatetest.csproj" /> <!-- test generators -->
1718
<DisabledProjects Include="$(TestRoot)Performance\Scenario\JitBench\unofficial_dotnet\JitBench.csproj" /> <!-- no official build support for SDK-style netcoreapp2.0 projects -->
1819
<DisabledProjects Include="$(TestRoot)reflection\GenericAttribute\GenericAttributeTests.csproj" />
1920
<DisabledProjects Include="$(TestRoot)TestWrappers*\**\*.csproj" />

0 commit comments

Comments
 (0)