| 1 | // RUN: rm -rf %t |
| 2 | // |
| 3 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c -DINCLUDE %s |
| 4 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DINCLUDE %s |
| 5 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -DINCLUDE %s |
| 6 | // |
| 7 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DAT_IMPORT=1 %s |
| 8 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c++ -DAT_IMPORT=1 %s |
| 9 | // |
| 10 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -fmodules-ts -DIMPORT=1 %s |
| 11 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c++ -fmodules-ts -DIMPORT=1 %s |
| 12 | // |
| 13 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c -DPRAGMA %s |
| 14 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DPRAGMA %s |
| 15 | // RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -DPRAGMA %s |
| 16 | |
| 17 | // expected-no-diagnostics |
| 18 | |
| 19 | // All forms of module import should make both declarations and macros visible. |
| 20 | |
| 21 | #if INCLUDE |
| 22 | #include "dummy.h" |
| 23 | #elif AT_IMPORT |
| 24 | @import dummy; |
| 25 | #elif IMPORT |
| 26 | import dummy; |
| 27 | #elif PRAGMA |
| 28 | #pragma clang module import dummy |
| 29 | #endif |
| 30 | |
| 31 | #ifndef DUMMY_H |
| 32 | #error "macros not visible" |
| 33 | #endif |
| 34 | |
| 35 | void *p = &dummy1; |
| 36 | |