Home | History | Annotate | Download | only in Modules
      1 // RUN: rm -rf %t
      2 // RUN: %clang_cc1 -fsyntax-only -DC1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
      3 // RUN: %clang_cc1 -fsyntax-only -DC1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
      4 // RUN: %clang_cc1 -fsyntax-only -DD1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
      5 // RUN: %clang_cc1 -fsyntax-only -DD1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
      6 // RUN: %clang_cc1 -fsyntax-only -DD2 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
      7 // RUN: %clang_cc1 -fsyntax-only -DD2 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
      8 // RUN: %clang_cc1 -fsyntax-only -DF1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
      9 // RUN: %clang_cc1 -fsyntax-only -DF1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
     10 //
     11 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DC1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
     12 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DC1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
     13 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
     14 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
     15 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD2 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
     16 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DD2 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
     17 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DF1 -I%S/Inputs/macro-reexport %s -fmodules-cache-path=%t -verify
     18 // RUN: %clang_cc1 -fmodules-local-submodule-visibility -fsyntax-only -DF1 -I%S/Inputs/macro-reexport -fmodules -fimplicit-module-maps %s -fmodules-cache-path=%t -verify
     19 
     20 #if defined(F1)
     21 #include "f1.h"
     22 void f() { return assert(true); } // expected-error {{undeclared identifier 'd'}}
     23 #include "e2.h" // undefines d1's macro
     24 void g() { return assert(true); } // expected-error {{undeclared identifier 'assert'}}
     25 #elif defined(D1)
     26 #include "e1.h" // undefines c1's macro but not d1's macro
     27 #include "d1.h"
     28 void f() { return assert(true); } // expected-error {{undeclared identifier 'd'}}
     29 #include "e2.h" // undefines d1's macro
     30 void g() { return assert(true); } // expected-error {{undeclared identifier 'assert'}}
     31 #elif defined(D2)
     32 #include "d2.h"
     33 void f() { return assert(true); } // expected-error {{undeclared identifier 'b'}}
     34 #else
     35 // e2 undefines d1's macro, which overrides c1's macro.
     36 #include "e2.h"
     37 #include "c1.h"
     38 void f() { return assert(true); } // expected-error {{undeclared identifier 'assert'}}
     39 #endif
     40