This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch]: more fixes for encode-[2-4].m testcases
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Cc: wilson at tuliptree dot org, zlaski at apple dot com
- Date: Sun, 1 Feb 2004 21:32:30 -0500 (EST)
- Subject: [Patch]: more fixes for encode-[2-4].m testcases
I'm still seeing failures for encode-[2-4].m in the objc testsuite on
mips-sgi-irix6.5, e.g. see:
http://gcc.gnu.org/ml/gcc-testresults/2004-02/msg00054.html
By following the discussion from the last round of fixes on these
tests, I was able to figure out myself this time what's going wrong.
Essentially since `char' is unsigned by default on irix, we're getting
'C' instead of 'c' as per the algorithm in objc-act.c:encode_type().
Fixed with the patch below. Tested by recompiling each testcase and
ensuring they ran to completion without aborting.
Ok for mainline and 3.4?
Thanks,
--Kaveh
2004-02-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* objc.dg/encode-2.m, objc.dg/encode-3.m, objc.dg/encode-4.m: Fix
tests for systems where `char' is unsigned by default.
diff -rup orig/egcc-CVS20040201/gcc/testsuite/objc.dg/encode-2.m egcc-CVS20040201/gcc/testsuite/objc.dg/encode-2.m
--- orig/egcc-CVS20040201/gcc/testsuite/objc.dg/encode-2.m Wed Jan 28 20:02:24 2004
+++ egcc-CVS20040201/gcc/testsuite/objc.dg/encode-2.m Sun Feb 1 20:21:46 2004
@@ -39,7 +39,7 @@ typedef struct { float x, y; } XXPoint;
typedef struct { float width, height; } XXSize;
typedef struct _XXRect { XXPoint origin; XXSize size; } XXRect;
-(id)setRect:(XXRect)r withInt:(int)i;
--(void) char:(char)c float:(float)f double:(double)d long:(long)l;
+-(void) char:(signed char)c float:(float)f double:(double)d long:(long)l;
@end
XXRect my_rect;
@@ -57,7 +57,7 @@ unsigned offs1, offs2, offs3, offs4, off
CHECK_IF(offs == offs1);
return nil;
}
--(void) char:(char)c float:(float)f double:(double)d long:(long)l {
+-(void) char:(signed char)c float:(float)f double:(double)d long:(long)l {
unsigned offs = sizeof(self);
CHECK_IF(offs == offs3);
offs += sizeof(_cmd);
diff -rup orig/egcc-CVS20040201/gcc/testsuite/objc.dg/encode-3.m egcc-CVS20040201/gcc/testsuite/objc.dg/encode-3.m
--- orig/egcc-CVS20040201/gcc/testsuite/objc.dg/encode-3.m Wed Jan 28 20:02:25 2004
+++ egcc-CVS20040201/gcc/testsuite/objc.dg/encode-3.m Sun Feb 1 20:24:19 2004
@@ -28,7 +28,7 @@ union __XXAngle { unsigned int alpha, be
typedef struct { float x, y; union __XXAngle a; } XXPoint;
typedef struct { double width, height; } XXSize;
typedef struct _XXRect { XXPoint origin; XXSize size; struct _XXRect *next; } XXRect;
-- (void) char:(char)c float:(float)f double:(double)d unsigned:(unsigned)u short:(short)s long:(long)l;
+- (void) char:(signed char)c float:(float)f double:(double)d unsigned:(unsigned)u short:(short)s long:(long)l;
- (void *)setRect:(XXRect)r withBool:(ProtoBool)b withInt:(int)i;
+ (Enum *)getEnum:(XXPoint *)pt enum:(enum Enum)e bool:(ObjCBool)b;
+ (ProtoBool **)getBool:(ObjCBool **)b;
diff -rup orig/egcc-CVS20040201/gcc/testsuite/objc.dg/encode-4.m egcc-CVS20040201/gcc/testsuite/objc.dg/encode-4.m
--- orig/egcc-CVS20040201/gcc/testsuite/objc.dg/encode-4.m Wed Sep 24 21:26:00 2003
+++ egcc-CVS20040201/gcc/testsuite/objc.dg/encode-4.m Sun Feb 1 20:29:12 2004
@@ -31,7 +31,7 @@ struct Nested {
};
@interface Int1: Object {
- char a, b;
+ signed char a, b;
Int2 *int2;
struct Nested nested;
}