blob: f7727a6579da460a5647855047ad039e28088106 [file] [log] [blame]
Duncan P. N. Exon Smith0a2be462019-03-09 17:44:01 +00001// RUN: rm -rf %t1 %t2 %t-include
2// RUN: mkdir %t-include
3// RUN: echo 'module D { header "D.h" }' >> %t-include/module.modulemap
4
5// Run with -verify, which onliy gets remarks from the main TU.
6//
7// RUN: echo '#define D 0' > %t-include/D.h
8// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t1 \
9// RUN: -fdisable-module-hash -fsyntax-only \
10// RUN: -I%S/Inputs/implicit-invalidate-chain -I%t-include \
11// RUN: -Rmodule-build -Rmodule-import %s
12// RUN: echo '#define D 11' > %t-include/D.h
13// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t1 \
14// RUN: -fdisable-module-hash -fsyntax-only \
15// RUN: -I%S/Inputs/implicit-invalidate-chain -I%t-include \
16// RUN: -Rmodule-build -Rmodule-import -verify %s
17
18// Run again, using FileCheck to check remarks from the module builds. This is
19// the key test: after the first attempt to import an out-of-date 'D', all the
20// modules have been invalidated and are not imported again until they are
21// rebuilt.
22//
23// RUN: echo '#define D 0' > %t-include/D.h
24// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t2 \
25// RUN: -fdisable-module-hash -fsyntax-only \
26// RUN: -I%S/Inputs/implicit-invalidate-chain -I%t-include \
27// RUN: -Rmodule-build -Rmodule-import %s
28// RUN: echo '#define D 11' > %t-include/D.h
29// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t2 \
30// RUN: -fdisable-module-hash -fsyntax-only \
31// RUN: -I%S/Inputs/implicit-invalidate-chain -I%t-include \
32// RUN: -Rmodule-build -Rmodule-import %s 2>&1 |\
33// RUN: FileCheck %s -implicit-check-not "remark:"
34
35#include "A.h" // \
Duncan P. N. Exon Smith2fd0d222019-03-09 19:33:32 +000036 expected-remark-re{{importing module 'A' from '{{.*[/\\]}}A.pcm'}} \
37 expected-remark-re{{importing module 'B' into 'A' from '{{.*[/\\]}}B.pcm'}} \
38 expected-remark-re{{importing module 'C' into 'B' from '{{.*[/\\]}}C.pcm'}} \
39 expected-remark-re{{importing module 'D' into 'C' from '{{.*[/\\]}}D.pcm'}} \
40 expected-remark-re{{building module 'A' as '{{.*[/\\]}}A.pcm'}} \
Duncan P. N. Exon Smith0a2be462019-03-09 17:44:01 +000041 expected-remark{{finished building module 'A'}} \
Duncan P. N. Exon Smith2fd0d222019-03-09 19:33:32 +000042 expected-remark-re{{importing module 'A' from '{{.*[/\\]}}A.pcm'}} \
43 expected-remark-re{{importing module 'B' into 'A' from '{{.*[/\\]}}B.pcm'}} \
44 expected-remark-re{{importing module 'C' into 'B' from '{{.*[/\\]}}C.pcm'}} \
45 expected-remark-re{{importing module 'D' into 'C' from '{{.*[/\\]}}D.pcm'}}
46// CHECK: remark: importing module 'A' from '{{.*[/\\]}}A.pcm'
47// CHECK: remark: importing module 'B' into 'A' from '{{.*[/\\]}}B.pcm'
48// CHECK: remark: importing module 'C' into 'B' from '{{.*[/\\]}}C.pcm'
49// CHECK: remark: importing module 'D' into 'C' from '{{.*[/\\]}}D.pcm'
Duncan P. N. Exon Smith0a2be462019-03-09 17:44:01 +000050// CHECK: remark: building module 'A'
51// CHECK: remark: building module 'B'
52// CHECK: remark: building module 'C'
53// CHECK: remark: building module 'D'
54// CHECK: remark: finished building module 'D'
Duncan P. N. Exon Smith2fd0d222019-03-09 19:33:32 +000055// CHECK: remark: importing module 'D' from '{{.*[/\\]}}D.pcm'
Duncan P. N. Exon Smith0a2be462019-03-09 17:44:01 +000056// CHECK: remark: finished building module 'C'
Duncan P. N. Exon Smith2fd0d222019-03-09 19:33:32 +000057// CHECK: remark: importing module 'C' from '{{.*[/\\]}}C.pcm'
58// CHECK: remark: importing module 'D' into 'C' from '{{.*[/\\]}}D.pcm'
Duncan P. N. Exon Smith0a2be462019-03-09 17:44:01 +000059// CHECK: remark: finished building module 'B'
Duncan P. N. Exon Smith2fd0d222019-03-09 19:33:32 +000060// CHECK: remark: importing module 'B' from '{{.*[/\\]}}B.pcm'
61// CHECK: remark: importing module 'C' into 'B' from '{{.*[/\\]}}C.pcm'
62// CHECK: remark: importing module 'D' into 'C' from '{{.*[/\\]}}D.pcm'
Duncan P. N. Exon Smith0a2be462019-03-09 17:44:01 +000063// CHECK: remark: finished building module 'A'
Duncan P. N. Exon Smith2fd0d222019-03-09 19:33:32 +000064// CHECK: remark: importing module 'A' from '{{.*[/\\]}}A.pcm'
65// CHECK: remark: importing module 'B' into 'A' from '{{.*[/\\]}}B.pcm'
66// CHECK: remark: importing module 'C' into 'B' from '{{.*[/\\]}}C.pcm'
67// CHECK: remark: importing module 'D' into 'C' from '{{.*[/\\]}}D.pcm'