xref: /aosp_15_r20/external/clang/test/Modules/modify-module.m (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li// Test that if we modify one of the input files used to form a
2*67e74705SXin Li// header, that module and dependent modules get rebuilt.
3*67e74705SXin Li
4*67e74705SXin Li// RUN: rm -rf %t
5*67e74705SXin Li// RUN: mkdir -p %t/include
6*67e74705SXin Li// RUN: cp %S/Inputs/Modified/A.h %t/include
7*67e74705SXin Li// RUN: cp %S/Inputs/Modified/B.h %t/include
8*67e74705SXin Li// RUN: cp %S/Inputs/Modified/module.map %t/include
9*67e74705SXin Li// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify
10*67e74705SXin Li// RUN: echo '' >> %t/include/B.h
11*67e74705SXin Li// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify
12*67e74705SXin Li// RUN: echo 'int getA(); int getA2();' > %t/include/A.h
13*67e74705SXin Li// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify
14*67e74705SXin Li// RUN: rm %t/cache/ModA.pcm
15*67e74705SXin Li// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify
16*67e74705SXin Li// RUN: touch %t/cache/ModA.pcm
17*67e74705SXin Li// RUN: %clang_cc1 -fdisable-module-hash -fmodules-cache-path=%t/cache -fmodules -fimplicit-module-maps -I %t/include %s -verify
18*67e74705SXin Li
19*67e74705SXin Li// expected-no-diagnostics
20*67e74705SXin Li
21*67e74705SXin Li// FIXME: It is intended to suppress this on win32.
22*67e74705SXin Li// REQUIRES: ansi-escape-sequences
23*67e74705SXin Li
24*67e74705SXin Li@import ModB;
25*67e74705SXin Li
26*67e74705SXin Liint getValue() { return getA() + getB(); }
27*67e74705SXin Li
28*67e74705SXin Li
29*67e74705SXin Li
30*67e74705SXin Li
31*67e74705SXin Li
32