summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rosdahl <joel@rosdahl.net>2020-07-05 20:34:54 +0200
committerJoel Rosdahl <joel@rosdahl.net>2020-07-06 09:27:14 +0200
commit62c2db048859206baa82b87d42d6e9e94e074efc (patch)
treeea43541b8f263997fcd2562aad273dd55ff1472d
parentc7455f6a5385f1c19dc3b6c93cc4b37c0320ec48 (diff)
downloadccache-62c2db048859206baa82b87d42d6e9e94e074efc.tar.gz
Skip “Directory is not hashed if using -gz[=zlib]” tests for GCC 6
The GCC 6 (tested with GCC 6.3) preprocessor includes the current working directory in the preprocessed output if run with -gz, which means that there won’t be cache hits between directories, thus failing the “Directory is not hashed if using -gz[=zlib]” tests. Fix this by skipping the test if the preprocessor behaves that way. Fixes #602. (cherry picked from commit 8b58982dc099a5ea2bbd8abc7803a9f5a3b1148d)
-rw-r--r--test/suites/base.bash6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/suites/base.bash b/test/suites/base.bash
index 7a864e94..bd5bbcbc 100644
--- a/test/suites/base.bash
+++ b/test/suites/base.bash
@@ -373,7 +373,8 @@ base_tests() {
# -------------------------------------------------------------------------
TEST "Directory is not hashed if using -gz"
- if $REAL_COMPILER -c test1.c -gz -o /dev/null 2>/dev/null; then
+ $REAL_COMPILER -E test1.c -gz >preprocessed.i 2>/dev/null
+ if [ -s preprocessed.i ] && ! fgrep -q $PWD preprocessed.i; then
mkdir dir1 dir2
cp test1.c dir1
cp test1.c dir2
@@ -395,7 +396,8 @@ base_tests() {
# -------------------------------------------------------------------------
TEST "Directory is not hashed if using -gz=zlib"
- if $REAL_COMPILER -c test1.c -gz=zlib -o /dev/null 2>/dev/null; then
+ $REAL_COMPILER -E test1.c -gz=zlib >preprocessed.i 2>/dev/null
+ if [ -s preprocessed.i ] && ! fgrep -q $PWD preprocessed.i; then
mkdir dir1 dir2
cp test1.c dir1
cp test1.c dir2