1 // RUN: rm -rf %t 2 // RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify -DUSE_EARLY 3 // RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify 4 5 // expected-note@Inputs/def.h:5 {{previous}} 6 7 @class Def; 8 Def *def; 9 10 @import decldef; 11 #ifdef USE_EARLY 12 A *a1; // expected-error{{declaration of 'A' must be imported from module 'decldef.Def' before it is required}} 13 #endif 14 B *b1; // expected-error{{must use 'struct' tag to refer to type 'B'}} 15 @import decldef.Decl; 16 17 A *a2; 18 struct B *b; 19 20 void testA(A *a) { 21 a->ivar = 17; 22 #ifndef USE_EARLY 23 // expected-error@-2{{definition of 'A' must be imported from module 'decldef.Def' before it is required}} 24 #endif 25 } 26 27 void testB() { 28 B b; // Note: redundant error silenced 29 } 30 31 void testDef() { 32 [def defMethod]; 33 } 34