Debian Codegraph @

clang/test/Modules/no-stale-modtime.m

raw
1 // Ensure that when rebuilding a module we don't save its old modtime when
2 // building modules that depend on it.
3
4 // RUN: rm -rf %t
5 // RUN: mkdir -p %t
6 // RUN: split-file %s %t
7
8 // RUN: cat %t/t.h-1 > %t/t.h
9
10 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
11 // RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build 2>&1 \
12 // RUN: | FileCheck -check-prefix=REBUILD-ALL %t/main.m
13 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
14 // RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build -verify
15
16 // Add an identifier to ensure everything depending on t is out of date
17 // RUN: cat %t/t.h-1 %t/t.h-2 > %t/t.h
18
19 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
20 // RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build 2>&1 \
21 // RUN: | FileCheck -check-prefix=REBUILD-ALL %t/main.m
22 // RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -fdisable-module-hash \
23 // RUN: -I %t -fsyntax-only %t/main.m -Rmodule-build -verify
24
25 //--- b.h
26 @import l; @import r;
27
28 //--- l.h
29 @import t; // fromt l
30
31 //--- r.h
32 @import t; // fromt r
33
34 //--- t.h-1
35 // top
36
37 //--- t.h-2
38 extern int a;
39
40 //--- module.modulemap
41 module b { header "b.h" } module l { header "l.h" }
42 module r { header "r.h" } module t { header "t.h" }
43
44 //--- main.m
45
46 // REBUILD-ALL: building module 'b'
47 // REBUILD-ALL: building module 'l'
48 // REBUILD-ALL: building module 't'
49 // REBUILD-ALL: building module 'r'
50
51 // Use -verify when expecting no modules to be rebuilt.
52 // expected-no-diagnostics
53 @import b;