diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-05-27 19:57:48 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-05-27 19:57:48 +0000 |
commit | 6fa878d86db35393bd1a1084be6ee2c042acceb7 (patch) | |
tree | a292c463adef8bd0ac0cf86e5fad57746a61743e /clang/test/Modules/no-stale-modtime.m | |
parent | 181ce5ee037c0ec227708d083b92202960d5ad69 (diff) | |
download | bcm5719-llvm-6fa878d86db35393bd1a1084be6ee2c042acceb7.tar.gz bcm5719-llvm-6fa878d86db35393bd1a1084be6ee2c042acceb7.zip |
Add a test that we don't store stale modtime in modules
The change from r209195 turned out to be important to avoid saving stale
modification time/expected size information in a module file when there
are 3 or more modules in a dependency chain and the bottom one is
rebuilt. So add a test for that.
rdar://problem/17038180
llvm-svn: 209682
Diffstat (limited to 'clang/test/Modules/no-stale-modtime.m')
-rw-r--r-- | clang/test/Modules/no-stale-modtime.m | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/clang/test/Modules/no-stale-modtime.m b/clang/test/Modules/no-stale-modtime.m new file mode 100644 index 00000000000..2fb17b763e7 --- /dev/null +++ b/clang/test/Modules/no-stale-modtime.m @@ -0,0 +1,37 @@ +// Ensure that when rebuilding a module we don't save its old modtime when +// building modules that depend on it. + +// REQUIRES: shell +// RUN: rm -rf %t +// RUN: mkdir -p %t +// This could be replaced by diamond_*, except we want to modify the top header +// RUN: echo '@import l; @import r;' > %t/b.h +// RUN: echo '@import t; // fromt l' > %t/l.h +// RUN: echo '@import t; // fromt r' > %t/r.h +// RUN: echo '// top' > %t/t.h +// RUN: echo 'module b { header "b.h" } module l { header "l.h" }' > %t/module.map +// RUN: echo 'module r { header "r.h" } module t { header "t.h" }' >> %t/module.map + +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \ +// RUN: -I %t -fsyntax-only %s -Wmodule-build 2>&1 \ +// RUN: | FileCheck -check-prefix=REBUILD-ALL %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \ +// RUN: -I %t -fsyntax-only %s -Wmodule-build -verify + +// Add an identifier to ensure everything depending on t is out of date +// RUN: echo 'extern int a;' >> %t/t.h +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \ +// RUN: -I %t -fsyntax-only %s -Wmodule-build 2>&1 \ +// RUN: | FileCheck -check-prefix=REBUILD-ALL %s +// RUN: %clang_cc1 -fmodules -fmodules-cache-path=%t -fdisable-module-hash \ +// RUN: -I %t -fsyntax-only %s -Wmodule-build -verify + +// REBUILD-ALL: building module 'b' +// REBUILD-ALL: building module 'l' +// REBUILD-ALL: building module 't' +// REBUILD-ALL: building module 'r' + +// Use -verify when expecting no modules to be rebuilt. +// expected-no-diagnostics + +@import b; |