blob: 143a00ff37a8ebe0e8888db27cc4913d595b76c3 [file] [log] [blame]
Volodymyr Sapsaif91b6f82019-08-28 23:31:32 +00001// RUN: rm -rf %t
2// RUN: mkdir -p %t/implicit-invalidate-common
3// RUN: cp -r %S/Inputs/implicit-invalidate-common %t/
4// RUN: echo '#include "A.h"' > %t/A.c
5// RUN: echo '#include "B.h"' > %t/B.c
6
7// Build with an empty module cache. Module 'Common' should be built only once.
8//
9// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
10// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
11// RUN: %t/A.c 2> %t/initial_build.txt
12// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
13// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
14// RUN: %t/B.c 2>> %t/initial_build.txt
15// RUN: FileCheck %s --implicit-check-not "remark:" --input-file %t/initial_build.txt
16
17// Update module 'Common' and build with the populated module cache. Module
18// 'Common' still should be built only once. Note that we are using the same
19// flags for A.c and B.c to avoid building Common.pcm at different paths.
20//
21// RUN: echo ' // ' >> %t/implicit-invalidate-common/Common.h
22// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
23// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
24// RUN: %t/A.c 2> %t/incremental_build.txt
25// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t/Cache \
26// RUN: -fsyntax-only -I %t/implicit-invalidate-common -Rmodule-build \
27// RUN: %t/B.c 2>> %t/incremental_build.txt
28// RUN: FileCheck %s --implicit-check-not "remark:" --input-file %t/incremental_build.txt
29
30// CHECK: remark: building module 'A'
31// CHECK: remark: building module 'Common'
32// CHECK: remark: finished building module 'Common'
33// CHECK: remark: finished building module 'A'
34// CHECK: remark: building module 'B'
35// CHECK: remark: finished building module 'B'