From: Joel Rosdahl Date: Wed, 7 Sep 2016 19:13:16 +0000 (+0200) Subject: Clean up X-Git-Tag: v3.3.1~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3df783673c60714dba52a8517e9a125b6e27cfb3;p=thirdparty%2Fccache.git Clean up --- diff --git a/ccache.c b/ccache.c index e60620493..8ffadccc1 100644 --- a/ccache.c +++ b/ccache.c @@ -1740,8 +1740,8 @@ calculate_object_hash(struct args *args, struct mdfour *hash, int direct_mode) free(gcda_name); } - // Adding -arch to hash since cpp output is affected - for(size_t i = 0; i < arch_args_size; ++i) { + // Adding -arch to hash since cpp output is affected. + for (size_t i = 0; i < arch_args_size; ++i) { hash_delimiter(hash, "-arch"); hash_string(hash, arch_args[i]); } diff --git a/test.sh b/test.sh index fe39a8220..6ca18c9bf 100755 --- a/test.sh +++ b/test.sh @@ -1125,18 +1125,18 @@ SUITE_multi_arch_SETUP() { } SUITE_multi_arch() { -# ------------------------------------------------------------------------- - TEST "cache hit" + # ------------------------------------------------------------------------- + TEST "cache hit, direct mode" # Different arches shouldn't affect each other $CCACHE_COMPILE -arch i386 -c test1.c expect_stat 'cache hit (direct)' 0 expect_stat 'cache miss' 1 - + $CCACHE_COMPILE -arch x86_64 -c test1.c expect_stat 'cache hit (direct)' 0 expect_stat 'cache miss' 2 - + $CCACHE_COMPILE -arch i386 -c test1.c expect_stat 'cache hit (direct)' 1 expect_stat 'cache miss' 2 @@ -1145,23 +1145,24 @@ SUITE_multi_arch() { $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c expect_stat 'cache hit (direct)' 1 expect_stat 'cache miss' 3 - + $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c expect_stat 'cache hit (direct)' 2 expect_stat 'cache miss' 3 - #The same for preprocessor mode - clear_cache + # ------------------------------------------------------------------------- + TEST "cache hit, preprocessor mode" + export CCACHE_NODIRECT=1 - + $CCACHE_COMPILE -arch i386 -c test1.c expect_stat 'cache hit (preprocessed)' 0 expect_stat 'cache miss' 1 - + $CCACHE_COMPILE -arch x86_64 -c test1.c expect_stat 'cache hit (preprocessed)' 0 expect_stat 'cache miss' 2 - + $CCACHE_COMPILE -arch i386 -c test1.c expect_stat 'cache hit (preprocessed)' 1 expect_stat 'cache miss' 2 @@ -1170,11 +1171,10 @@ SUITE_multi_arch() { $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c expect_stat 'cache hit (preprocessed)' 1 expect_stat 'cache miss' 3 - + $CCACHE_COMPILE -arch i386 -arch x86_64 -c test1.c expect_stat 'cache hit (preprocessed)' 2 expect_stat 'cache miss' 3 - } # ============================================================================= @@ -2445,7 +2445,7 @@ SUITE_readonly() { test_failed "Read-only mode + direct mode stored files in the cache" fi } - + # ============================================================================= SUITE_readonly_direct_SETUP() {