| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fexceptions" } */ |
| 3 |
|
| 4 |
typedef struct objc_object { Class class_pointer; } *id; |
| 5 |
typedef unsigned char BOOL; |
| 6 |
|
| 7 |
@interface Object |
| 8 |
{ |
| 9 |
Class isa; |
| 10 |
} |
| 11 |
@end |
| 12 |
|
| 13 |
@interface Object (Test) |
| 14 |
- (BOOL)testIsEqual:anObject; |
| 15 |
@end |
| 16 |
|
| 17 |
@implementation Object (Test) |
| 18 |
- (BOOL)testIsEqual:anObject |
| 19 |
{ |
| 20 |
return self == anObject; |
| 21 |
} |
| 22 |
@end |
| 23 |
|
| 24 |
#ifdef __NEXT_RUNTIME__ |
| 25 |
@interface NSConstantString: Object |
| 26 |
{ |
| 27 |
char *c_string; |
| 28 |
unsigned int len; |
| 29 |
} |
| 30 |
@end |
| 31 |
extern void *_NSConstantStringClassReference; |
| 32 |
#else |
| 33 |
@interface NXConstantString: Object |
| 34 |
{ |
| 35 |
char *c_string; |
| 36 |
unsigned int len; |
| 37 |
} |
| 38 |
@end |
| 39 |
#endif |
| 40 |
|
| 41 |
void function (void) |
| 42 |
{ |
| 43 |
if ([@"strings" testIsEqual: (id)0]) |
| 44 |
{ |
| 45 |
; |
| 46 |
} |
| 47 |
} |
| 48 |
|