From patchwork Sun Oct 11 14:17:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1380391 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C8P5w1lTRz9sSn for ; Mon, 12 Oct 2020 01:17:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 70E3E3857C52; Sun, 11 Oct 2020 14:17:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp1.wavenetuk.net (smtp.wavenetuk.net [195.26.36.10]) by sourceware.org (Postfix) with ESMTP id 932FC3857C4E for ; Sun, 11 Oct 2020 14:17:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 932FC3857C4E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sandoe.co.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=iain@sandoe.co.uk Received: from [192.168.1.212] (host81-138-1-83.in-addr.btopenworld.com [81.138.1.83]) by smtp1.wavenetuk.net (Postfix) with ESMTPA id DCFBF1201369 for ; Sun, 11 Oct 2020 15:17:31 +0100 (BST) From: Iain Sandoe Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: [pushed] testsuite, Objective-C : Adjust gnu-api tests for Darwin. Message-Id: <9EFFC435-18D8-4041-B492-2A17EAF83114@sandoe.co.uk> Date: Sun, 11 Oct 2020 15:17:11 +0100 To: GCC Patches X-Mailer: Apple Mail (2.3273) X-Spam-Status: No, score=-16.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_COUK, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KHOP_HELO_FCRDNS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Hi (Darwin tests both the GNU and NeXT runtimes) The GNU v2 API matches the next v2 API in most respects. However, some of the tests depend on access to items that the later NeXT headers consider to be 'internal implementation details' and are not exposed (we arrange that with a DEFINE). One test is skipped here because, although it works internally, the number of objects returned is larger for the NeXT runtime in some cases (where the headers have been updated to bring in more of the system details). tested across the Darwin range, and on x86_64-linux pushed to master thanks Iain gcc/testsuite/ChangeLog: * objc.dg/gnu-api-2-class-meta.m: Add a flag to cause NeXT headers to expose prototypes for messaging. Mark the root class if the objc_root_class attribute is available. Use char ** as the second arg to main. * objc.dg/gnu-api-2-class.m: Use dispatch prototype. * objc.dg/gnu-api-2-objc.m: Skip on NeXT because of extra prototypes pulled in by headers. --- gcc/testsuite/objc.dg/gnu-api-2-class-meta.m | 6 +++++- gcc/testsuite/objc.dg/gnu-api-2-class.m | 1 + gcc/testsuite/objc.dg/gnu-api-2-objc.m | 8 ++++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m b/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m index 07e0ba2884a..3a85b163c91 100644 --- a/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m +++ b/gcc/testsuite/objc.dg/gnu-api-2-class-meta.m @@ -20,6 +20,7 @@ /* { dg-do run } */ /* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-options "-DOBJC_OLD_DISPATCH_PROTOTYPES" { target { *-*-darwin* } } } */ /* To get the modern GNU Objective-C Runtime API, you include objc/runtime.h. */ @@ -28,6 +29,9 @@ #include #include +#if __has_attribute(objc_root_class) +__attribute__((objc_root_class)) +#endif @interface MyRootClass { Class isa; } + alloc; @@ -65,7 +69,7 @@ static id static_variable = nil; + (id) mySelf; @end -int main(int argc, void **args) +int main(int argc, char **args) { /* Functions are tested in alphabetical order. */ diff --git a/gcc/testsuite/objc.dg/gnu-api-2-class.m b/gcc/testsuite/objc.dg/gnu-api-2-class.m index 341952969e8..eade0dcbbfa 100644 --- a/gcc/testsuite/objc.dg/gnu-api-2-class.m +++ b/gcc/testsuite/objc.dg/gnu-api-2-class.m @@ -7,6 +7,7 @@ /* { dg-do run } */ /* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ /* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* { dg-additional-options "-DOBJC_OLD_DISPATCH_PROTOTYPES" { target { *-*-darwin* } } } */ /* To get the modern GNU Objective-C Runtime API, you include objc/runtime.h. */ diff --git a/gcc/testsuite/objc.dg/gnu-api-2-objc.m b/gcc/testsuite/objc.dg/gnu-api-2-objc.m index d65c120455e..1b4ce8e4799 100644 --- a/gcc/testsuite/objc.dg/gnu-api-2-objc.m +++ b/gcc/testsuite/objc.dg/gnu-api-2-objc.m @@ -3,8 +3,12 @@ This is test 'objc', covering all functions starting with 'objc'. */ /* { dg-do run } */ -/* { dg-skip-if "No API#2 pre-Darwin9" { *-*-darwin[5-8]* } { "-fnext-runtime" } { "" } } */ -/* { dg-xfail-run-if "Needs OBJC2 ABI" { *-*-darwin* && { lp64 && { ! objc2 } } } { "-fnext-runtime" } { "" } } */ +/* Although this works with the NeXT runtime in a sub-set of cases, some + versions of the runtime header pulls in a number of system protocols, + which causes the objc_copyProtocolList test to fail (in addition to those + systems that don't have the V2 APis). XFAILing the run is not useful + since it will XPASS on the sub-set that works. */ +/* { dg-skip-if "Incompatible" { *-*-darwin* } { "-fnext-runtime" } { "" } } */ /* To get the modern GNU Objective-C Runtime API, you include objc/runtime.h. */