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