summaryrefslogtreecommitdiff
path: root/test/Driver/modules.m
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2016-07-26 17:12:17 +0000
committerManman Ren <manman.ren@gmail.com>2016-07-26 17:12:17 +0000
commitcefd54750c4216d515b019df09eccd7c13c7612c (patch)
tree611e6c22e67f1849a8c3d4bfeebbf96fd40e10e9 /test/Driver/modules.m
parent0d8977c1408c28d3ebe5a5f65ceeab1db6572d89 (diff)
downloadclang-cefd54750c4216d515b019df09eccd7c13c7612c.tar.gz
Modules: add command line option fmodules-disable-diagnostic-validation
With PCH+Module, sometimes compiler gives a hard error: Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt This happens when we have a pch importing a module and the module gets overwritten by another compiler instance after we build the pch (one example is that both compiler instances hash to the same pcm file but use different diagnostic options). When we try to load the pch later on, the compiler notices that the imported module is out of date (modification date, size do not match) but it can't handle this out of date pcm (i.e it does not know how to rebuild the pch). This commit introduces a new command line option so for PCH + module, we can turn on this option and if two compiler instances only differ in diagnostic options, the latter instance will not invalidate the original pcm. rdar://26675801 Differential Revision: http://reviews.llvm.org/D22773 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Driver/modules.m')
-rw-r--r--test/Driver/modules.m6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/Driver/modules.m b/test/Driver/modules.m
index 0f2d4d5bb0..fd66478047 100644
--- a/test/Driver/modules.m
+++ b/test/Driver/modules.m
@@ -33,6 +33,12 @@
// RUN: %clang -fmodules-validate-system-headers -### %s 2>&1 | FileCheck -check-prefix=MODULES_VALIDATE_SYSTEM_HEADERS %s
// MODULES_VALIDATE_SYSTEM_HEADERS: -fmodules-validate-system-headers
+// RUN: %clang -### %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT %s
+// MODULES_DISABLE_DIAGNOSTIC_VALIDATION_DEFAULT-NOT: -fmodules-disable-diagnostic-validation
+
+// RUN: %clang -fmodules-disable-diagnostic-validation -### %s 2>&1 | FileCheck -check-prefix=MODULES_DISABLE_DIAGNOSTIC_VALIDATION %s
+// MODULES_DISABLE_DIAGNOSTIC_VALIDATION: -fmodules-disable-diagnostic-validation
+
// RUN: %clang -fmodules -fmodule-map-file=foo.map -fmodule-map-file=bar.map -### %s 2>&1 | FileCheck -check-prefix=CHECK-MODULE-MAP-FILES %s
// CHECK-MODULE-MAP-FILES: "-fmodules"
// CHECK-MODULE-MAP-FILES: "-fmodule-map-file=foo.map"