From b9de02c457877540b1812ddf04a83ab1defdb24f Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 7 Oct 2021 20:15:54 +0200 Subject: [PATCH] [introspection] Skip verifying the objc_msgSend[Super]_stret on all platforms. (#12939) Now that macOS runs on ARM64 (and also the simulators soon), we need to have to same logic for all platforms. Fixes: Introspection.iOSApiPInvokeTest [FAIL] Could not find the field 'objc_msgSend_stret' in /usr/lib/libobjc.dylib [FAIL] Could not find the field 'objc_msgSendSuper_stret' in /usr/lib/libobjc.dylib [FAIL] SymbolExists : 2 errors found in 5300 functions validated: objc_msgSend_stret, objc_msgSendSuper_stret Expected: 0 But was: 2 at Introspection.ApiPInvokeTest.SymbolExists() in /Users/builder/azdo/_work/1/s/xamarin-macios/tests/introspection/ApiPInvokeTest.cs:line 182 --- tests/introspection/ApiPInvokeTest.cs | 7 +++++++ tests/introspection/Mac/MacApiPInvokeTest.cs | 2 +- tests/introspection/iOS/iOSApiPInvokeTest.cs | 4 ---- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/introspection/ApiPInvokeTest.cs b/tests/introspection/ApiPInvokeTest.cs index 1a54008d69f1..9fba4f0654b3 100644 --- a/tests/introspection/ApiPInvokeTest.cs +++ b/tests/introspection/ApiPInvokeTest.cs @@ -124,6 +124,13 @@ protected virtual bool CheckForEnumParameter (MethodInfo mi, ParameterInfo pi) protected virtual bool Skip (string symbolName) { + switch (symbolName) { + // it's not needed for ARM64/ARM64_32 and Apple does not have stubs for them in libobjc.dylib + // also the linker normally removes them (unreachable due to other optimizations) + case "objc_msgSend_stret": + case "objc_msgSendSuper_stret": + return true; + } return false; } diff --git a/tests/introspection/Mac/MacApiPInvokeTest.cs b/tests/introspection/Mac/MacApiPInvokeTest.cs index 5aa7fe2faa8a..5762ba5fe5f3 100644 --- a/tests/introspection/Mac/MacApiPInvokeTest.cs +++ b/tests/introspection/Mac/MacApiPInvokeTest.cs @@ -63,7 +63,7 @@ protected override bool Skip (string symbolName) case "SKTerminateForInvalidReceipt": // Only there for API compat return !IsUnified; } - return false; + return base.Skip (symbolName); } protected override bool SkipAssembly (Assembly a) diff --git a/tests/introspection/iOS/iOSApiPInvokeTest.cs b/tests/introspection/iOS/iOSApiPInvokeTest.cs index 2e063019776a..1dd76864dfdd 100644 --- a/tests/introspection/iOS/iOSApiPInvokeTest.cs +++ b/tests/introspection/iOS/iOSApiPInvokeTest.cs @@ -59,10 +59,6 @@ protected override bool Skip (string symbolName) case "CVPixelBufferGetIOSurface": case "CVPixelBufferCreateWithIOSurface": return simulator && !TestRuntime.CheckXcodeVersion (11, 0); - // it's not needed for ARM64/ARM64_32 and Apple does not have stubs for them in libobjc.dylib - case "objc_msgSend_stret": - case "objc_msgSendSuper_stret": - return !simulator; default: // MLCompute not available in simulator as of Xcode 12 beta 3