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: 57478 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp120855wrn; Wed, 15 Feb 2023 02:55:01 -0800 (PST) X-Google-Smtp-Source: AK7set/bacY/BUshJ1Fh3tme5CgGUTpxXUXAYmWWfTO5oNmf2CO7X5pffPaIj8U6Se4RcUwqnlU8 X-Received: by 2002:a17:907:2054:b0:878:7530:5303 with SMTP id pg20-20020a170907205400b0087875305303mr2022586ejb.5.1676458501585; Wed, 15 Feb 2023 02:55:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676458501; cv=none; d=google.com; s=arc-20160816; b=QkVrAKJirbcXpKUMVxrM6cq1EtsT5uE8rRuTTjFZxfCOHhZYYD4NKwc7yqxz8tYLBb IIEyWK4Ol5MI9m8j69vKtfgXlvjhfoIhOQiS1TZAGIaxxEw59cj0BhLb3ejlXVxemMuM WdFZrJqCKo1zoUi1iumhv2UxMScjfXmIAyJVs2NUVWpAv6cWG3SusfyZ85r+RR9V3e66 2m7P+XQ8Z1xv75Qp/boTgoKEeRZfMhjN+tavsK4WBPhDbng2LSgM1Mgfj8DeIEsU/Bye OHei0h6AcU56SK07xghmgzWu58GHrQbT1MWdt0+7UQ8rJnHXgJ+j+1mEnbF0Gp0+CVzh 6kXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=14tj1WV/mso8nyk/lXw03fBOzH5wy42h4fgo5uhLC3o=; b=dGGBGoRAWt6P5b1IrUg28mUFC+VvM4sXGSV5xJpl9Qbl2peqFTyqDB3G6XRpsYBkup 0BkgpdqmE+TqV0Yr30JUuMIN7+eL3ngnZWe44BkalaV1FRZQ/srrtC4s5KAEzFMjJex9 mCV/zXYj8fzdkX2xzkWJZN4YjBEXVTvqYQjF8M2a8g296NmmkpT8sQOCHoYOhcxF1YVf NDiwIWpK6MgukjG3taSjpIeW7nkFTm1Kb7+rP4of/o5YElrLFBPkUN9OYmp6ECe4Yg25 Jkn+Rad9vAlyyhStOQe56XbH5DBQZu1Nr9fku+3TkBJ3/et9pbJKKkMn8iGC6aHQdka+ lDJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eV4EQkqu; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ew6-20020a170907950600b008b125fd7e79si5716523ejc.838.2023.02.15.02.55.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Feb 2023 02:55:01 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=eV4EQkqu; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 121473858407 for ; Wed, 15 Feb 2023 10:55:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 121473858407 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1676458500; 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=eV4EQkquHH68sjH+5j/Vx/7CnrE96inhim8/+yhLMdT0vUIk/PSP7oH7J2YBnkMTe pA1Lq8Xw3IVXiwMZgXhDz89drYKyPnNfnQcqzZjA2OVbHU276VOSKR8zyqV6cr5v2R 9vsq1ya1EpBOwmBLcpDCXESgz3TgsFO/piTjpp3E= 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-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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757894149382876347?= X-GMAIL-MSGID: =?utf-8?q?1757894149382876347?= 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 } */