/* Test looking up fields in superclasses in the context of write-barriers
|
/* Test looking up fields in superclasses in the context of write-barriers
|
(where component references get rewritten). */
|
(where component references get rewritten). */
|
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
|
/* Contributed by Ziemowit Laski <zlaski@apple.com> */
|
|
|
/* { dg-do compile } */
|
/* { dg-do compile } */
|
/* { dg-options "-fobjc-gc" } */
|
/* { dg-options "-fobjc-gc" } */
|
/* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
|
/* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
|
|
|
#include "../objc-obj-c++-shared/Object1.h"
|
#include "../objc-obj-c++-shared/Object1.h"
|
|
|
@class MyWindow;
|
@class MyWindow;
|
|
|
@interface MyDocument : Object {
|
@interface MyDocument : Object {
|
MyWindow *_window;
|
MyWindow *_window;
|
}
|
}
|
@end
|
@end
|
|
|
@interface MyFileDocument : MyDocument {
|
@interface MyFileDocument : MyDocument {
|
struct {
|
struct {
|
unsigned int autoClose:1;
|
unsigned int autoClose:1;
|
unsigned int openForUI:1;
|
unsigned int openForUI:1;
|
unsigned int isClosing:1;
|
unsigned int isClosing:1;
|
unsigned int needsDiskCheck:1;
|
unsigned int needsDiskCheck:1;
|
unsigned int isWritable:1;
|
unsigned int isWritable:1;
|
unsigned int representsFileOnDisk:1;
|
unsigned int representsFileOnDisk:1;
|
unsigned int RESERVED:26;
|
unsigned int RESERVED:26;
|
} _fdFlags;
|
} _fdFlags;
|
}
|
}
|
@end
|
@end
|
|
|
@interface MyTextFileDocument : MyFileDocument {
|
@interface MyTextFileDocument : MyFileDocument {
|
Object *_textStorage;
|
Object *_textStorage;
|
struct __tfdFlags {
|
struct __tfdFlags {
|
unsigned int immutable:1;
|
unsigned int immutable:1;
|
unsigned int lineEnding:2;
|
unsigned int lineEnding:2;
|
unsigned int isClosing:1;
|
unsigned int isClosing:1;
|
unsigned int settingsAreSet:1;
|
unsigned int settingsAreSet:1;
|
unsigned int usesTabs:1;
|
unsigned int usesTabs:1;
|
unsigned int isUTF8WithBOM:1;
|
unsigned int isUTF8WithBOM:1;
|
unsigned int wrapsLines:1;
|
unsigned int wrapsLines:1;
|
unsigned int usingDefaultLanguage:1;
|
unsigned int usingDefaultLanguage:1;
|
unsigned int RESERVED:23;
|
unsigned int RESERVED:23;
|
} _tfdFlags;
|
} _tfdFlags;
|
int _tabWidth;
|
int _tabWidth;
|
int _indentWidth;
|
int _indentWidth;
|
}
|
}
|
@end
|
@end
|
|
|
@interface MyRTFFileDocument : MyTextFileDocument
|
@interface MyRTFFileDocument : MyTextFileDocument
|
- (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type;
|
- (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type;
|
@end
|
@end
|
|
|
@implementation MyRTFFileDocument
|
@implementation MyRTFFileDocument
|
- (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type {
|
- (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type {
|
if (_textStorage && fileName) {
|
if (_textStorage && fileName) {
|
[_textStorage free];
|
[_textStorage free];
|
return YES;
|
return YES;
|
} else if (type) {
|
} else if (type) {
|
_textStorage = [MyRTFFileDocument new];
|
_textStorage = [MyRTFFileDocument new];
|
return NO;
|
return NO;
|
}
|
}
|
return (fileName && type);
|
return (fileName && type);
|
}
|
}
|
@end
|
@end
|
|
|