Fix crossgenning of sparse COM interface types on non-Windows and add test (#40404)
authorJeremy Koritzinsky <jekoritz@microsoft.com>
Thu, 6 Aug 2020 00:52:34 +0000 (17:52 -0700)
committerGitHub <noreply@github.com>
Thu, 6 Aug 2020 00:52:34 +0000 (17:52 -0700)
src/coreclr/src/zap/zapimage.cpp
src/tests/baseservices/typeequivalence/contracts/TypeContracts.csproj
src/tests/baseservices/typeequivalence/impl/TypeImpl.csproj
src/tests/baseservices/typeequivalence/simple/Simple.cs
src/tests/baseservices/typeequivalence/simple/Simple.csproj

index e113942..6939219 100644 (file)
@@ -1894,7 +1894,6 @@ void ZapImage::TryCompileMethodStub(LPVOID pContext, CORINFO_METHOD_HANDLE hStub
 //-----------------------------------------------------------------------------
 BOOL ZapImage::IsVTableGapMethod(mdMethodDef md)
 {
-#ifdef FEATURE_COMINTEROP
     HRESULT hr;
     DWORD dwAttributes;
 
@@ -1916,9 +1915,6 @@ BOOL ZapImage::IsVTableGapMethod(mdMethodDef md)
 
     // If we make it to here we have a vtable gap method.
     return TRUE;
-#else
-    return FALSE;
-#endif // FEATURE_COMINTEROP
 }
 
 //-----------------------------------------------------------------------------
index ce626df..306758e 100644 (file)
@@ -1,8 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
-    <!-- The Type Equivalence feature is unsupported outside of windows -->
-    <CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Types.cs" />
index 4c64a59..b916b70 100644 (file)
@@ -1,8 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Library</OutputType>
-    <!-- The Type Equivalence feature is unsupported outside of windows -->
-    <CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Impls.cs" />
index 9b0a63e..fbfb5db 100644 (file)
@@ -216,6 +216,10 @@ public class Simple
 
     public static int Main(string[] noArgs)
     {
+        if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+        {
+            return 100;
+        }
         try
         {
             InterfaceTypesFromDifferentAssembliesAreEquivalent();
index e53815c..028b3cc 100644 (file)
@@ -1,8 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
     <OutputType>Exe</OutputType>
-    <!-- The Type Equivalence feature is unsupported outside of windows -->
-    <CLRTestTargetUnsupported Condition="'$(TargetsWindows)' != 'true'">true</CLRTestTargetUnsupported>
   </PropertyGroup>
   <ItemGroup>
     <Compile Include="Simple.cs" />