}
}
+ // Possibly hash input file location to avoid false positive cache hits since
+ // the dependency file includes the source file path.
+ if (generating_dependencies) {
+ hash_delimiter(hash, "inputfile");
+ hash_string(hash, input_file);
+ }
+
// Possibly hash the coverage data file path.
if (generating_coverage && profile_arcs) {
char *dir = dirname(output_obj);
expect_stat 'cache miss' 0
expect_stat 'unsupported compiler option' 1
+ # -------------------------------------------------------------------------
+ TEST "-MMD for different source files"
+
+ mkdir a b
+ touch a/source.c b/source.c
+ $CCACHE_COMPILE -MMD -c a/source.c
+ expect_file_content source.d "source.o: a/source.c"
+
+ $CCACHE_COMPILE -MMD -c b/source.c
+ expect_file_content source.d "source.o: b/source.c"
+
+ $CCACHE_COMPILE -MMD -c a/source.c
+ expect_file_content source.d "source.o: a/source.c"
+
# -------------------------------------------------------------------------
TEST "-Wp,-P"
expect_stat 'cache hit (preprocessed)' 1
expect_stat 'cache miss' 1
+ # -------------------------------------------------------------------------
+ TEST "-MMD for different source files"
+
+ mkdir a b
+ touch a/source.c b/source.c
+ $CCACHE_COMPILE -MMD -c a/source.c
+ expect_file_content source.d "source.o: a/source.c"
+
+ $CCACHE_COMPILE -MMD -c b/source.c
+ expect_file_content source.d "source.o: b/source.c"
+
+ $CCACHE_COMPILE -MMD -c a/source.c
+ expect_file_content source.d "source.o: a/source.c"
+
# -------------------------------------------------------------------------
TEST "Multiple object entries in manifest"