From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1698) id 1A86B3858402; Mon, 22 Apr 2024 13:10:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A86B3858402 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1713791410; bh=C8n9qCOeTcWFX/PVc4FBhoiq0Id0l3Z2+w6Pjj+CjTg=; h=From:To:Subject:Date:From; b=ma1wt9aLLqjf0QiqRAZ9MtYFKQNYyQ52fA7SlbqHR80cLWwCvFQfPNuZQ1+xx/vGC xjaNb4QIDFQC8SYdBTMXK5x2CGgdVDfm/jZFKk6+aLmp81UQdnmiJQAX/AGi8wobZP YYjG/HYVpbCpWjTOAXM9jqLvWeA9+cuqhOyjr5hE= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Iain D Sandoe To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-11335] testsuite, objective-c: Fix a testcase on Windows. X-Act-Checkin: gcc X-Git-Author: Iain Sandoe X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 8af693c4ae1a0f8cecef34e98dad1752ebf0bb75 X-Git-Newrev: ce169d2712296b193ecb94768fee1477bb0d0ed0 Message-Id: <20240422131010.1A86B3858402@sourceware.org> Date: Mon, 22 Apr 2024 13:10:10 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ce169d2712296b193ecb94768fee1477bb0d0ed0 commit r11-11335-gce169d2712296b193ecb94768fee1477bb0d0ed0 Author: Iain Sandoe Date: Wed Feb 15 10:47:51 2023 +0000 testsuite, objective-c: Fix a testcase on Windows. 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. (cherry picked from commit 142bd88c5f609546a466743ab1066d5620a830bc) Diff: --- 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 } */