This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch objc testsuite]: Fix testcase for scalar pointer type issue
- From: IainS <developer at sandoe-acoustics dot co dot uk>
- To: Kai Tietz <ktietz70 at googlemail dot com>
- Cc: Mike Stump <mrs at gcc dot gnu dot org>, Nicola Pero <nicola dot pero at meta-innovation dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 5 Oct 2010 14:51:57 +0100
- Subject: Re: [patch objc testsuite]: Fix testcase for scalar pointer type issue
- References: <OF9AE888F0.D0343D7A-ONC12577AD.00544ABF-C12577AD.005498F6@onevision.de> <AANLkTin3XJK7EAvc4v+XA8kkCaWhKpm+TYm4+YvA1A-Y@mail.gmail.com> <AANLkTim0WReFFio3sBx_4temDDiqTFwAAHJAFuSUOm2c@mail.gmail.com>
Hi Kai,
does the following work for you?
(it is more within the guidelines given for use of the macros in say:
http://gcc.gnu.org/onlinedocs/cpp/Common-Predefined-Macros.html#Common-Predefined-Macros)
Iain
Index: gcc/testsuite/objc.dg/proto-lossage-4.m
===================================================================
--- gcc/testsuite/objc.dg/proto-lossage-4.m (revision 164977)
+++ gcc/testsuite/objc.dg/proto-lossage-4.m (working copy)
@@ -3,36 +3,38 @@
/* Author: Ziemowit Laski <zlaski@apple.com>. */
/* { dg-do compile } */
+#include <stdint.h>
+
/* One-line substitute for objc/objc.h */
typedef struct objc_object { struct objc_class *class_pointer; } *id;
@protocol Proto
-- (long)someValue;
+- (intptr_t)someValue;
@end
@interface Obj
-- (long)anotherValue;
+- (intptr_t)anotherValue;
@end
long foo(void) {
- long receiver = 2;
+ intptr_t receiver = 2;
Obj *objrcvr;
Obj <Proto> *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 .intptr_t." } */
+ receiver += [receiver anotherValue]; /* { dg-warning "invalid
receiver type .intptr_t." } */
receiver += [(Obj *)receiver someValue]; /* { dg-warning ".Obj.
may not respond to .\\-someValue." } */
-/* { dg-warning "assignment makes integer from pointer without a
cast" "" { target *-*-* } 28 } */
+/* { dg-warning "assignment makes integer from pointer without a
cast" "" { target *-*-* } 30 } */
receiver += [(Obj *)receiver anotherValue];
receiver += [(Obj <Proto> *)receiver someValue];
receiver += [(Obj <Proto> *)receiver anotherValue];
receiver += [objrcvr someValue]; /* { dg-warning ".Obj. may not
respond to .\\-someValue." } */
-/* { dg-warning "assignment makes integer from pointer without a
cast" "" { target *-*-* } 34 } */
+/* { dg-warning "assignment makes integer from pointer without a
cast" "" { target *-*-* } 36 } */
receiver += [objrcvr anotherValue];
receiver += [(Obj <Proto> *)objrcvr someValue];
@@ -40,7 +42,7 @@ long foo(void) {
receiver += [objrcvr2 someValue];
receiver += [objrcvr2 anotherValue];
receiver += [(Obj *)objrcvr2 someValue]; /* { dg-warning ".Obj.
may not respond to .\\-someValue." } */
-/* { dg-warning "assignment makes integer from pointer without a
cast" "" { target *-*-* } 42 } */
+/* { dg-warning "assignment makes integer from pointer without a
cast" "" { target *-*-* } 44 } */
receiver += [(Obj *)objrcvr2 anotherValue];
On 5 Oct 2010, at 14:16, Kai Tietz wrote:
Ping
2010/9/30 NightStrike <nightstrike@gmail.com>:
Ping
On Wed, Sep 29, 2010 at 11:24 AM, Kai Tietz
<Kai.Tietz@onevision.com> wrote:
Hello,
This test didn't handled LLP64 case correctly.
ChangeLog gcc/testsuite
2010-09-29 Kai Tietz
* objc.dg/proto-lossage-4.m: Use __INTPTR_TYPE__ instead of
long type.
Tested for x86_64-pc-mingw32, and i686-pc-cygwin. Ok for apply?
Regards,
i.A. Kai Tietz
| (\_/) This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.
--
| (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination