From patchwork Wed Feb 15 10:54:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 1742779 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=YZLXWrrN; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4PGw265lmDz23r4 for ; Wed, 15 Feb 2023 21:54:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5D09A3858C30 for ; Wed, 15 Feb 2023 10:54:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D09A3858C30 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676458476; bh=14tj1WV/mso8nyk/lXw03fBOzH5wy42h4fgo5uhLC3o=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=YZLXWrrNT7AH5WKGHvr/rM41UxRYk7JTOJ7qdtmvgq0vOLfrNl36y1560Q4nG3wz5 N25QyIfn8R/kfsqCUSk6j83zsorBoXSX8MzTQoyKRaphAbDs44m5EYtVafs4G+S1zO i/fwUD7aJOJYyQouPjPq5eJ35v9mR4rMiSDPRKsk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by sourceware.org (Postfix) with ESMTPS id 875A03858D35 for ; Wed, 15 Feb 2023 10:54:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 875A03858D35 Received: by mail-wr1-x435.google.com with SMTP id s13so950311wrw.3 for ; Wed, 15 Feb 2023 02:54:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=14tj1WV/mso8nyk/lXw03fBOzH5wy42h4fgo5uhLC3o=; b=w4e3hPlsaH7NvDkxNhqsMsff8RHVHchHEY35MN/XyrfJK1vcXha4bTrBe0BrERzKZj q1euKSs3nJd1gFG5adVt3eyalhx0IkHUA5oawqdjatd+t8YjGWXserMVoMGsk2R752sG 4MPYrlgHE2zyFhddn1xVUIYx/+bc+Xn3UCzwY/lRgB9MAGluJe29q/umigi5h53fSmYD hV1J/aFelZZ7oyVo1szuQskCdfdIfJn0VTBgMNVzirvR+Mdc+RHjE+hFoJocPZf5OLvW nx4/Qu6p4riIOAIc5KGHT5PiYaSd1qEVN9YzAoFCqjeaUPXkqg2vJZRSE4rzDhbdPim6 CBPg== X-Gm-Message-State: AO0yUKXcKOqnfaIYpxDpqtAewriEW+j2EtJ7OA14rdEqhcp+5riXzymP DMEK7HhRAVozsu3Hl+DacLZ7+tl+J7I= X-Google-Smtp-Source: AK7set8/Qpft3R/TI9AEGQZ16qr8FmQBruov94H6liRdovE8l8gEenaeRfqfbyDW440hxJ1Bw1utdQ== X-Received: by 2002:adf:e54e:0:b0:2c5:56fe:3de6 with SMTP id z14-20020adfe54e000000b002c556fe3de6mr1341280wrm.45.1676458453052; Wed, 15 Feb 2023 02:54:13 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id z12-20020a056000110c00b002c563b124basm4000593wrw.103.2023.02.15.02.54.12 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 15 Feb 2023 02:54:12 -0800 (PST) X-Google-Original-From: Iain Sandoe To: gcc-patches@gcc.gnu.org Subject: [pushed] testsuite, objective-c: Fix a testcase on Windows. Date: Wed, 15 Feb 2023 10:54:11 +0000 Message-Id: <20230215105411.30966-1-iain@sandoe.co.uk> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: , X-Patchwork-Original-From: Iain Sandoe via Gcc-patches From: Iain Sandoe Reply-To: iain@sandoe.co.uk Cc: Iain Sandoe Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" tested by 'nightstrike' on Windows, and on x86_64-darwin21, pushed to master, thanks, Iain --- 8< --- Windows needs to use uintptr_t to represent an integral pointer type (long is not the right type there). Patch from 'nightstike'. Signed-off-by: Iain Sandoe gcc/testsuite/ChangeLog: * obj-c++.dg/proto-lossage-4.mm: Use uintptr_t for integral pointer representations. --- gcc/testsuite/obj-c++.dg/proto-lossage-4.mm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm b/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm index 2e753d1f8ba..ff053bec7d0 100644 --- a/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm +++ b/gcc/testsuite/obj-c++.dg/proto-lossage-4.mm @@ -6,24 +6,26 @@ /* One-line substitute for objc/objc.h */ typedef struct objc_object { struct objc_class *class_pointer; } *id; +typedef __UINTPTR_TYPE__ uintptr_t; + @protocol Proto -- (long)someValue; +- (uintptr_t)someValue; @end @interface Obj -- (long)anotherValue; +- (uintptr_t)anotherValue; @end -long foo(void) { - long receiver = 2; +uintptr_t foo(void) { + uintptr_t receiver = 2; Obj *objrcvr; Obj *objrcvr2; /* NB: Since 'receiver' is an invalid ObjC message receiver, the compiler should warn but then search for methods as if we were messaging 'id'. */ - receiver += [receiver someValue]; /* { dg-warning "invalid receiver type .long int." } */ - receiver += [receiver anotherValue]; /* { dg-warning "invalid receiver type .long int." } */ + receiver += [receiver someValue]; /* { dg-warning "invalid receiver type .uintptr_t." } */ + receiver += [receiver anotherValue]; /* { dg-warning "invalid receiver type .uintptr_t." } */ receiver += [(Obj *)receiver someValue]; /* { dg-warning ".Obj. may not respond to .\\-someValue." } */ /* { dg-error "invalid conversion" "" { target *-*-* } .-1 } */