mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-24 12:31:25 +08:00
fix for targets with different long and ptr sizes.
* objc.dg/proto-lossage-4.m: Use intptr_t instead of long type. Co-Authored-By: Kai Tietz <kai.tietz@onevision.com> From-SVN: r165121
This commit is contained in:
parent
fa45f8d7f2
commit
58be5bf69d
gcc/testsuite
@ -1,3 +1,8 @@
|
||||
2010-10-07 Iain Sandoe <iains@gcc.gnu.org>
|
||||
Kai Tietz <kai.tietz@onevision.com>
|
||||
|
||||
* objc.dg/proto-lossage-4.m: Use intptr_t instead of long type.
|
||||
|
||||
2010-10-07 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/45732
|
||||
|
@ -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];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user