Skip to content

Commit

Permalink
Disable native varargs for Windows arm (dotnet#38147)
Browse files Browse the repository at this point in the history
* Make native args disabled for Windows ARM
* Re-enable the ArgIteratorTests for Windows ARM
* Update the comment to be more specific
* flip the #ifdef condition
* make #ifdef consistent
* formatting
  • Loading branch information
kunalspathak authored Jun 19, 2020
1 parent 1869ee6 commit 7d5dd34
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public ref struct ArgIterator
private IntPtr ArgPtr; // Pointer to remaining args.
private int RemainingArgs; // # of remaining args.

#if TARGET_WINDOWS // Native Varargs are not supported on Unix
#if (TARGET_WINDOWS && !TARGET_ARM) // Native Varargs are not supported on Unix (all architectures) and Windows ARM
[MethodImpl(MethodImplOptions.InternalCall)]
private extern ArgIterator(IntPtr arglist);

Expand Down
7 changes: 4 additions & 3 deletions src/coreclr/src/jit/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@
#ifndef TARGET_H_
#define TARGET_H_

#if defined(TARGET_UNIX)
#define FEATURE_VARARG 0
#else
// Native Varargs are not supported on Unix (all architectures) and Windows ARM
#if defined(TARGET_WINDOWS) && !defined(TARGET_ARM)
#define FEATURE_VARARG 1
#else
#define FEATURE_VARARG 0
#endif

/*****************************************************************************/
Expand Down
7 changes: 0 additions & 7 deletions src/libraries/System.Runtime/tests/System/ArgIteratorTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using Microsoft.DotNet.XUnitExtensions;
using System.Globalization;
using System.Reflection;
using Xunit;
Expand Down Expand Up @@ -91,12 +90,6 @@ private static void VerifyTypes(Type[] types, __arglist)
[ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsArgIteratorNotSupported))]
public static unsafe void ArgIterator_Throws_PlatformNotSupportedException()
{
if (PlatformDetection.IsWindows && PlatformDetection.IsArmProcess)
{
// Active Issue: https://github.com/dotnet/runtime/issues/35754
throw new SkipTestException("ArgIterator doesn't throw not supported in ArmProcess");
}

Assert.Throws<PlatformNotSupportedException>(() => new ArgIterator(new RuntimeArgumentHandle()));
Assert.Throws<PlatformNotSupportedException>(() => {
fixed (void* p = "test")
Expand Down

0 comments on commit 7d5dd34

Please sign in to comment.