From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-x435.google.com with SMTP id s13so950311wrw.3 for ; Wed, 15 Feb 2023 02:54:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:reply-to:message-id:date :subject:to:from:from:to:cc:subject:date:message-id:reply-to; bh=14tj1WV/mso8nyk/lXw03fBOzH5wy42h4fgo5uhLC3o=; b=VXwbTKM2YkJRIWrPg9weKgo3dNHqgRbVKrlnENudOv6Y357WHRA8NUcISMXTz+X89O 9ulVPJ8QLCtZKYjtTW1f3RGZQBCRFM7GsVNsIiDNnnqwWaXx9cH5Cr7hhnrLnhUf2R2b ZNd5Gyah9C3zSb9AZ3ArGFCQ4BeOL0WPSLIOryzZJ0AZRglQd2aVCCKhifys1eBurNFy NNQYwfeytpMLRoLBbZ5aJ0QPBnhkfbOewrORtBVPyjA2cDGMk4nhO4NlY4dOZheBOQAT /vfCzeI2yyXr8XKtj9qKXJCbvzoLXxsbGpl5Kxps2lhDUYJcsxi5nlvaLqlCq/AIrxmK 4uPA== 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) From: Iain Sandoe 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) Reply-To: iain@sandoe.co.uk MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 List-Id: 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 } */ -- 2.37.1 (Apple Git-137.1)