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 } */
6 /* { dg-options "-fobjc-gc" } */
7 /* { dg-prune-output "cc1obj: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
9 #include "../objc-obj-c++-shared/Object1.h"
13 @interface MyDocument : Object {
18 @interface MyFileDocument : MyDocument {
20 unsigned int autoClose:1;
21 unsigned int openForUI:1;
22 unsigned int isClosing:1;
23 unsigned int needsDiskCheck:1;
24 unsigned int isWritable:1;
25 unsigned int representsFileOnDisk:1;
26 unsigned int RESERVED:26;
31 @interface MyTextFileDocument : MyFileDocument {
34 unsigned int immutable:1;
35 unsigned int lineEnding:2;
36 unsigned int isClosing:1;
37 unsigned int settingsAreSet:1;
38 unsigned int usesTabs:1;
39 unsigned int isUTF8WithBOM:1;
40 unsigned int wrapsLines:1;
41 unsigned int usingDefaultLanguage:1;
42 unsigned int RESERVED:23;
49 @interface MyRTFFileDocument : MyTextFileDocument
50 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type;
53 @implementation MyRTFFileDocument
54 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type {
55 if (_textStorage && fileName) {
59 _textStorage = [MyRTFFileDocument new];
62 return (fileName && type);