This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch objc testsuite]: Fix testcase for scalar pointer type issue


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]