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/TestsuiteObject.h"
10 #include <objc/objc.h>
14 @interface MyDocument : TestsuiteObject {
19 @interface MyFileDocument : MyDocument {
21 unsigned int autoClose:1;
22 unsigned int openForUI:1;
23 unsigned int isClosing:1;
24 unsigned int needsDiskCheck:1;
25 unsigned int isWritable:1;
26 unsigned int representsFileOnDisk:1;
27 unsigned int RESERVED:26;
32 @interface MyTextFileDocument : MyFileDocument {
33 TestsuiteObject *_textStorage;
35 unsigned int immutable:1;
36 unsigned int lineEnding:2;
37 unsigned int isClosing:1;
38 unsigned int settingsAreSet:1;
39 unsigned int usesTabs:1;
40 unsigned int isUTF8WithBOM:1;
41 unsigned int wrapsLines:1;
42 unsigned int usingDefaultLanguage:1;
43 unsigned int RESERVED:23;
50 @interface MyRTFFileDocument : MyTextFileDocument
51 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type;
54 @implementation MyRTFFileDocument
55 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type {
56 if (_textStorage && fileName) {
60 _textStorage = [MyRTFFileDocument new];
63 return (fileName && type);