| 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 -DPRAGMA %s |
| 11 |
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x objective-c -DPRAGMA %s |
| 12 |
// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fimplicit-module-maps -I%S/Inputs -verify -x c++ -DPRAGMA %s |
| 13 |
|
| 14 |
// expected-no-diagnostics |
| 15 |
|
| 16 |
// All forms of module import should make both declarations and macros visible. |
| 17 |
|
| 18 |
#if INCLUDE |
| 19 |
#include "dummy.h" |
| 20 |
#elif AT_IMPORT |
| 21 |
@import dummy; |
| 22 |
#elif PRAGMA |
| 23 |
#pragma clang module import dummy |
| 24 |
#endif |
| 25 |
|
| 26 |
#ifndef DUMMY_H |
| 27 |
#error "macros not visible" |
| 28 |
#endif |
| 29 |
|
| 30 |
void *p = &dummy1; |