Home | History | Annotate | Download | only in Modules
      1 // RUN: rm -rf %t
      2 // RUN: %clang_cc1 -fmodules -fobjc-arc -I %S/Inputs -fmodules-cache-path=%t %s -verify
      3 
      4 // expected-note@Inputs/def.h:5 {{previous definition is here}}
      5 
      6 @class Def;
      7 Def *def;
      8 class Def2;
      9 Def2 *def2;
     10 
     11 @interface Unrelated
     12 - defMethod;
     13 @end
     14 
     15 @import decldef;
     16 A *a1; // expected-error{{unknown type name 'A'}}
     17 B *b1; // expected-error{{unknown type name 'B'}}
     18 @import decldef.Decl;
     19 
     20 A *a2;
     21 B *b;
     22 
     23 void testA(A *a) {
     24   a->ivar = 17; // expected-error{{definition of 'A' must be imported from module 'decldef.Def' before it is required}}
     25 }
     26 
     27 void testB() {
     28   B b; // Note: redundant error silenced
     29 }
     30 
     31 void testDef() {
     32   [def defMethod];
     33 }
     34 
     35 void testDef2() {
     36   def2->func();
     37 }
     38