Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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: 1 addition & 2 deletions src/coreclr/nativeaot/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@
<DefineConstants Condition="'$(FeatureCominterop)' == 'true'">FEATURE_COMINTEROP;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<FeatureComWrappers>false</FeatureComWrappers>
<FeatureComWrappers Condition="'$(TargetsWindows)' == 'true'">true</FeatureComWrappers>
<FeatureComWrappers>true</FeatureComWrappers>
</PropertyGroup>
<PropertyGroup>
<FeatureObjCMarshal>false</FeatureObjCMarshal>
Expand Down
5 changes: 5 additions & 0 deletions src/tests/Common/CoreCLRTestLibrary/PlatformDetection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace TestLibrary
Expand All @@ -26,5 +27,9 @@ public static class PlatformDetection
public static bool IsMonoLLVMAOT => _variant == "llvmaot";
public static bool IsMonoLLVMFULLAOT => _variant == "llvmfullaot";
public static bool IsMonoInterpreter => _variant == "monointerpreter";

public static bool IsMonoRuntime => Type.GetType("Mono.RuntimeStructs") != null;

public static bool IsNativeAot => !IsMonoRuntime && !RuntimeFeature.IsDynamicCodeSupported;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NativeAotIncompatible>false</NativeAotIncompatible>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NativeAotIncompatible>false</NativeAotIncompatible>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.cs" />
Expand Down
9 changes: 7 additions & 2 deletions src/tests/Interop/COM/ComWrappers/API/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ namespace ComWrappersTests
using System.Runtime.InteropServices;

using ComWrappersTests.Common;
using TestLibrary;
using Xunit;

class Program
Expand Down Expand Up @@ -713,8 +714,12 @@ static int Main()
ValidateBadComWrapperImpl();
ValidateRuntimeTrackerScenario();
ValidateQueryInterfaceAfterManagedObjectCollected();
ValidateAggregationWithComObject();
ValidateAggregationWithReferenceTrackerObject();

if (!PlatformDetection.IsNativeAot)
{
ValidateAggregationWithComObject();
ValidateAggregationWithReferenceTrackerObject();
}

// Ensure all objects have been cleaned up.
ForceGC();
Expand Down