1// REQUIRES: shell
2// RUN: rm -rf %t
3// RUN: mkdir -p %t
4
5// RUN: echo '@import B;' > %t/A.h
6// RUN: echo '@import C;' > %t/B.h
7// RUN: echo '@import D;' >> %t/B.h
8// RUN: echo '// C.h' > %t/C.h
9// RUN: echo '// D.h' > %t/D.h
10// RUN: echo 'module A { header "A.h" }' > %t/module.modulemap
11// RUN: echo 'module B { header "B.h" }' >> %t/module.modulemap
12// RUN: echo 'module C { header "C.h" }' >> %t/module.modulemap
13// RUN: echo 'module D { header "D.h" }' >> %t/module.modulemap
14
15// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %t %s -verify
16// RUN: echo " " >> %t/D.h
17// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -I %t %s -verify
18// expected-no-diagnostics
19
20
21@import C;
22@import A;
23@import C;
24// When compiling A, C will be be loaded then removed when D fails. Ensure
25// this does not cause problems importing C again later.
26