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