1 /* Test looking up fields in superclasses in the context of write-barriers
2 (where component references get rewritten). */
3 /* Contributed by Ziemowit Laski <zlaski@apple.com> */
5 /* { dg-do compile { target *-*-darwin* } } */
6 /* { dg-options "-fobjc-gc" } */
8 #include <objc/Object.h>
12 @interface MyDocument : Object {
17 @interface MyFileDocument : MyDocument {
19 unsigned int autoClose:1;
20 unsigned int openForUI:1;
21 unsigned int isClosing:1;
22 unsigned int needsDiskCheck:1;
23 unsigned int isWritable:1;
24 unsigned int representsFileOnDisk:1;
25 unsigned int RESERVED:26;
30 @interface MyTextFileDocument : MyFileDocument {
33 unsigned int immutable:1;
34 unsigned int lineEnding:2;
35 unsigned int isClosing:1;
36 unsigned int settingsAreSet:1;
37 unsigned int usesTabs:1;
38 unsigned int isUTF8WithBOM:1;
39 unsigned int wrapsLines:1;
40 unsigned int usingDefaultLanguage:1;
41 unsigned int RESERVED:23;
48 @interface MyRTFFileDocument : MyTextFileDocument
49 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type;
52 @implementation MyRTFFileDocument
53 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type {
54 if (_textStorage && fileName) {
58 _textStorage = [MyRTFFileDocument new];
61 return (fileName && type);