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-skip-if "GC API is an error from Darwin16." { *-*-darwin1[6-8]* } { "-fnext-runtime" } { "" } } */
7 /* { dg-options "-fobjc-gc" } */
8 /* { dg-prune-output "cc1objplus: warning: '-fobjc-gc' is ignored for '-fgnu-runtime'" } */
10 #include "../objc-obj-c++-shared/TestsuiteObject.h"
11 #include "../objc-obj-c++-shared/runtime.h"
15 @interface MyDocument : TestsuiteObject {
20 @interface MyFileDocument : MyDocument {
22 unsigned int autoClose:1;
23 unsigned int openForUI:1;
24 unsigned int isClosing:1;
25 unsigned int needsDiskCheck:1;
26 unsigned int isWritable:1;
27 unsigned int representsFileOnDisk:1;
28 unsigned int RESERVED:26;
33 @interface MyTextFileDocument : MyFileDocument {
34 TestsuiteObject *_textStorage;
36 unsigned int immutable:1;
37 unsigned int lineEnding:2;
38 unsigned int isClosing:1;
39 unsigned int settingsAreSet:1;
40 unsigned int usesTabs:1;
41 unsigned int isUTF8WithBOM:1;
42 unsigned int wrapsLines:1;
43 unsigned int usingDefaultLanguage:1;
44 unsigned int RESERVED:23;
51 @interface MyRTFFileDocument : MyTextFileDocument
52 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type;
55 @implementation MyRTFFileDocument
56 - (BOOL)readFromFile:(const char *)fileName ofType:(const char *)type {
57 if (_textStorage && fileName) {
61 _textStorage = [MyRTFFileDocument new];
64 return (fileName && type);