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