| 1 |
// RUN: rm -rf %t |
| 2 |
// RUN: split-file %s %t |
| 3 |
// RUN: %clang_cc1 -I %t/include -fmodules -fimplicit-module-maps \ |
| 4 |
// RUN: -fmodules-cache-path=%t/cache -fsyntax-only %t/tu.c |
| 5 |
|
| 6 |
//--- include/module.modulemap |
| 7 |
module A [no_undeclared_includes] { textual header "A.h" } |
| 8 |
module B { header "B.h" } |
| 9 |
|
| 10 |
//--- include/A.h |
| 11 |
#if __has_include(<B.h>) |
| 12 |
#error B.h should not be available from A.h. |
| 13 |
#endif |
| 14 |
|
| 15 |
//--- include/B.h |
| 16 |
// This file intentionally left blank. |
| 17 |
|
| 18 |
//--- tu.c |
| 19 |
#if !__has_include(<B.h>) |
| 20 |
#error B.h should be available from tu.c. |
| 21 |
#endif |
| 22 |
|
| 23 |
#include "A.h" |
| 24 |
|
| 25 |
#if !__has_include(<B.h>) |
| 26 |
#error B.h should still be available from tu.c. |
| 27 |
#endif |