]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
preprocessor mode: enable using identical header in different paths
authorJohn Basila <jbasila@checkpoint.com>
Sat, 21 May 2016 13:20:33 +0000 (16:20 +0300)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 21 Jul 2016 19:48:59 +0000 (21:48 +0200)
ccache.c
test.sh

index faa39f0df93319734d5952001b82778661e169a9..f4d97cae0793bf7b46e5b9f01be5565fc39b09d9 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -887,7 +887,6 @@ process_preprocessed_file(struct mdfour *hash, const char *path)
                                has_absolute_include_headers = is_absolute_path(path);
                        }
                        path = make_relative_path(path);
-                       hash_string(hash, path);
                        remember_include_file(path, hash, system);
                        p = r;
                } else {
diff --git a/test.sh b/test.sh
index 9aeeee3cf5fc258398f63571f1b6f12f6df7b2f7..b74d212b45ca5e55a8fb28bb28a5818f25a63834 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1280,8 +1280,8 @@ EOF
     checkstat 'cache miss' 1
     $CCACHE $COMPILER -c `pwd`/file.c
     checkstat 'cache hit (direct)' 1
-    checkstat 'cache hit (preprocessed)' 0
-    checkstat 'cache miss' 2
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 1
 
     testname="__FILE__ in include file"
     $CCACHE -Cz >/dev/null
@@ -1304,8 +1304,8 @@ EOF
     mv file_h.c file2_h.c
     $CCACHE $COMPILER -c `pwd`/file2_h.c
     checkstat 'cache hit (direct)' 1
-    checkstat 'cache hit (preprocessed)' 0
-    checkstat 'cache miss' 2
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 1
 
     ##################################################################
     # Check that direct mode ignores __FILE__ if sloppiness is specified.
@@ -1491,12 +1491,12 @@ EOF
     checkstat 'cache miss' 1
     CPATH=subdir2 $CCACHE $COMPILER -c foo.c
     checkstat 'cache hit (direct)' 1
-    checkstat 'cache hit (preprocessed)' 0
-    checkstat 'cache miss' 2 # subdir2 is part of the preprocessor output
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 1 # subdir2 is part of the preprocessor output
     CPATH=subdir2 $CCACHE $COMPILER -c foo.c
     checkstat 'cache hit (direct)' 2
-    checkstat 'cache hit (preprocessed)' 0
-    checkstat 'cache miss' 2
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 1
 
     testname="comment in strings"
     $CCACHE -Cz >/dev/null
@@ -1615,8 +1615,8 @@ EOF
     cd dir2
     CCACHE_BASEDIR="" $CCACHE $COMPILER -I`pwd`/include -c src/test.c
     checkstat 'cache hit (direct)' 0
-    checkstat 'cache hit (preprocessed)' 0
-    checkstat 'cache miss' 2
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 1
     cd ..
 
     ##################################################################
@@ -1671,8 +1671,8 @@ EOF
     $CCACHE -z >/dev/null
     $CCACHE $COMPILER -I`pwd`/include -c src/test.c
     checkstat 'cache hit (direct)' 0
-    checkstat 'cache hit (preprocessed)' 0
-    checkstat 'cache miss' 1
+    checkstat 'cache hit (preprocessed)' 1
+    checkstat 'cache miss' 0
     cd ..
 
     ##################################################################