1 // Without PCH 2 // RUN: %clang_cc1 -fsyntax-only -verify -include %s -include %s %s 3 4 // With PCH 5 // RUN: %clang_cc1 -fsyntax-only -verify %s -chain-include %s -chain-include %s 6 7 #ifndef HEADER1 8 #define HEADER1 9 //===----------------------------------------------------------------------===// 10 // Primary header 11 12 @interface NSObject 13 - (id)init; 14 - (void)finalize; 15 @end 16 17 //===----------------------------------------------------------------------===// 18 #elif !defined(HEADER2) 19 #define HEADER2 20 #if !defined(HEADER1) 21 #error Header inclusion order messed up 22 #endif 23 24 //===----------------------------------------------------------------------===// 25 // Dependent header 26 27 @interface MyClass : NSObject 28 +(void)meth; 29 @end 30 31 @interface NSObject(ObjExt) 32 -(void)extMeth; 33 @end 34 35 //===----------------------------------------------------------------------===// 36 #else 37 //===----------------------------------------------------------------------===// 38 39 @implementation MyClass 40 +(void)meth {} 41 -(void)finalize { 42 [super finalize]; 43 } 44 @end 45 46 void test(NSObject *o) { 47 [o extMeth]; 48 } 49 50 //===----------------------------------------------------------------------===// 51 #endif 52