]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
test: Cope with CC being a wrapper script that uses ccache
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 20 Sep 2021 05:38:27 +0000 (07:38 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 20 Sep 2021 17:14:59 +0000 (19:14 +0200)
Fixes #914.

23 files changed:
test/run
test/suites/base.bash
test/suites/basedir.bash
test/suites/color_diagnostics.bash
test/suites/cpp1.bash
test/suites/debug_prefix_map.bash
test/suites/depend.bash
test/suites/direct.bash
test/suites/direct_gcc.bash
test/suites/fileclone.bash
test/suites/hardlink.bash
test/suites/input_charset.bash
test/suites/masquerading.bash
test/suites/no_compression.bash
test/suites/nvcc.bash
test/suites/nvcc_direct.bash
test/suites/nvcc_ldir.bash
test/suites/pch.bash
test/suites/profiling.bash
test/suites/sanitize_blacklist.bash
test/suites/serialize_diagnostics.bash
test/suites/source_date_epoch.bash
test/suites/split_dwarf.bash

index b9abc094803346b89718635119f65d0bd82ed761..d8b5466b3070dea943a03d0f484b764a048ffc25 100755 (executable)
--- a/test/run
+++ b/test/run
@@ -458,13 +458,14 @@ for HOST_CCACHE_DIR in $HOST_CCACHE_DIRS; do
 done
 export PATH
 
-if [ -n "$CC" ]; then
-    COMPILER="$CC"
-elif [[ "$OSTYPE" == "darwin"* && -x "$(command -v clang)" ]]; then
-    COMPILER=clang
-else
-    COMPILER=gcc
+if [ -z "$CC" ]; then
+    if [[ "$OSTYPE" == "darwin"* && -x "$(command -v clang)" ]]; then
+        CC=clang
+    else
+        CC=gcc
+    fi
 fi
+
 if [ -z "$CCACHE" ]; then
     CCACHE=`pwd`/ccache
 fi
@@ -485,17 +486,17 @@ HOST_OS_FREEBSD=false
 HOST_OS_WINDOWS=false
 HOST_OS_CYGWIN=false
 
-compiler_version="`$COMPILER --version 2>/dev/null | head -1`"
+compiler_version="`$CC --version 2>/dev/null | head -1`"
 case $compiler_version in
     *gcc*|*g++*|2.95*)
         COMPILER_TYPE_GCC=true
         ;;
     *clang*)
         COMPILER_TYPE_CLANG=true
-        CLANG_VERSION_SUFFIX=$(echo "${COMPILER%% *}" | sed 's/.*clang//')
+        CLANG_VERSION_SUFFIX=$(echo "${CC%% *}" | sed 's/.*clang//')
         ;;
     *)
-        echo "WARNING: Compiler $COMPILER not supported (version: $compiler_version) -- Skipped running tests" >&2
+        echo "WARNING: Compiler $CC not supported (version: $compiler_version) -- Skipped running tests" >&2
         exit $skip_code
         ;;
 esac
@@ -574,22 +575,19 @@ symlink_testdir_on_failure() {
     ln -s "$$" "$TEST_FAILED_SYMLINK"
 }
 
-cd $TESTDIR || exit 1
-
-COMPILER_BIN=$(echo $COMPILER | awk '{print $1}')
-COMPILER_ARGS=$(echo $COMPILER | awk '{$1 = ""; print}')
+COMPILER_BIN=$(echo $CC | awk '{print $1}')
+COMPILER_ARGS=$(echo $CC | awk '{$1 = ""; print}')
 REAL_COMPILER_BIN=$(find_compiler $COMPILER_BIN)
 REAL_COMPILER="$REAL_COMPILER_BIN$COMPILER_ARGS"
+REAL_NVCC=$(find_compiler nvcc)
 
-if [ "$REAL_COMPILER" = "$COMPILER" ]; then
-    echo "Compiler:         $COMPILER"
+if [ "$REAL_COMPILER_BIN" = "$COMPILER_BIN" ]; then
+    echo "Compiler:         $CC"
 else
-    echo "Compiler:         $COMPILER ($REAL_COMPILER)"
+    echo "Compiler:         $CC ($REAL_COMPILER)"
 fi
-echo "Compiler version: $($COMPILER --version 2>/dev/null | head -n 1)"
+echo "Compiler version: $($CC --version 2>/dev/null | head -n 1)"
 
-REAL_NVCC=$(find_compiler nvcc)
-REAL_CUOBJDUMP=$(find_compiler cuobjdump)
 if [ -n "$REAL_NVCC" ]; then
     echo "CUDA compiler:    $($REAL_NVCC --version | tail -n 1) ($REAL_NVCC)"
 else
@@ -597,6 +595,18 @@ else
 fi
 echo
 
+cd $TESTDIR || exit 1
+
+mkdir compiler
+COMPILER="$(pwd)/compiler/$(basename "$REAL_COMPILER_BIN")"
+cat >"$COMPILER" <<EOF
+#!/bin/sh
+
+CCACHE_DISABLE=1 CCACHE_COMPILER= CCACHE_PREFIX= \
+  exec $COMPILER_BIN$COMPILER_ARGS "\$@"
+EOF
+chmod +x "$COMPILER"
+
 [ -z "${VERBOSE:-}" ] && verbose=false || verbose=true
 [ "$1" = "-v" ] && { verbose=true; shift; }
 
@@ -624,4 +634,3 @@ else
     green PASSED
     exit 0
 fi
-
index cc6d140de519471ebf5548669d9b9c8872d3797f..8cc2e6cb776b88e64a8a3eaaa115689f1ffeb751 100644 (file)
@@ -2,7 +2,7 @@ base_tests() {
     # -------------------------------------------------------------------------
     TEST "Base case"
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
     $CCACHE_COMPILE -c test1.c
     expect_stat preprocessed_cache_hit 0
@@ -33,7 +33,7 @@ base_tests() {
     # E.g. due to some suboptimal setup, scripts etc. Source:
     # https://github.com/ccache/ccache/issues/686
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
     $CCACHE $COMPILER -c test1.c
     expect_stat preprocessed_cache_hit 0
@@ -75,7 +75,7 @@ base_tests() {
     expect_stat preprocessed_cache_hit 1
     expect_stat cache_miss 1
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c -g
+    $COMPILER -c -o reference_test1.o test1.c -g
     expect_equal_object_files reference_test1.o test1.o
 
     # -------------------------------------------------------------------------
@@ -89,7 +89,7 @@ base_tests() {
     expect_stat preprocessed_cache_hit 1
     expect_stat cache_miss 1
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
     expect_equal_object_files reference_test1.o foo.o
 
     # -------------------------------------------------------------------------
@@ -107,7 +107,7 @@ base_tests() {
     expect_stat preprocessed_cache_hit 2
     expect_stat cache_miss 1
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
     expect_equal_object_files reference_test1.o dir
     expect_equal_object_files reference_test1.o ptf
 
@@ -387,7 +387,7 @@ fi
     # -------------------------------------------------------------------------
     TEST "CCACHE_COMMENTS"
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
     mv test1.c test1-saved.c
     echo '// initial comment' >test1.c
@@ -402,7 +402,7 @@ fi
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 2
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
     expect_equal_object_files reference_test1.o test1.o
 
     # -------------------------------------------------------------------------
@@ -454,7 +454,7 @@ fi
     expect_stat cache_miss 1
     expect_stat recache 1
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
     expect_equal_object_files reference_test1.o test1.o
 
     expect_stat files_in_cache 1
@@ -525,7 +525,7 @@ fi
     # -------------------------------------------------------------------------
     TEST "Directory is not hashed if using -gz"
 
-    $REAL_COMPILER -E test1.c -gz >preprocessed.i 2>/dev/null
+    $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
@@ -548,7 +548,7 @@ fi
     # -------------------------------------------------------------------------
     TEST "Directory is not hashed if using -gz=zlib"
 
-    $REAL_COMPILER -E test1.c -gz=zlib >preprocessed.i 2>/dev/null
+    $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
@@ -682,7 +682,7 @@ b"
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 1
 
-    $REAL_COMPILER -c test1.c -E >test1.i
+    $COMPILER -c test1.c -E >test1.i
     $CCACHE_COMPILE -c test1.i
     expect_stat preprocessed_cache_hit 1
     expect_stat cache_miss 1
@@ -776,7 +776,7 @@ b"
     # -------------------------------------------------------------------------
     TEST "-frecord-gcc-switches"
 
-    if $REAL_COMPILER -frecord-gcc-switches -c test1.c >&/dev/null; then
+    if $COMPILER -frecord-gcc-switches -c test1.c >&/dev/null; then
         $CCACHE_COMPILE -frecord-gcc-switches -c test1.c
         expect_stat preprocessed_cache_hit 0
         expect_stat cache_miss 1
@@ -797,15 +797,18 @@ b"
     # -------------------------------------------------------------------------
     TEST "CCACHE_COMPILER"
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
+    export CCACHE_DEBUG=1
+    export CCACHE_DEBUGDIR=/tmp/a
     $CCACHE_COMPILE -c test1.c
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 1
     expect_stat files_in_cache 1
     expect_equal_object_files reference_test1.o test1.o
 
-    CCACHE_COMPILER=$COMPILER_BIN $CCACHE \
+    export CCACHE_DEBUGDIR=/tmp/b
+    CCACHE_COMPILER=$COMPILER $CCACHE \
         non_existing_compiler_will_be_overridden_anyway \
         $COMPILER_ARGS -c test1.c
     expect_stat preprocessed_cache_hit 1
@@ -813,14 +816,14 @@ b"
     expect_stat files_in_cache 1
     expect_equal_object_files reference_test1.o test1.o
 
-    CCACHE_COMPILER=$COMPILER_BIN $CCACHE same/for/relative \
+    CCACHE_COMPILER=$COMPILER $CCACHE same/for/relative \
         $COMPILER_ARGS -c test1.c
     expect_stat preprocessed_cache_hit 2
     expect_stat cache_miss 1
     expect_stat files_in_cache 1
     expect_equal_object_files reference_test1.o test1.o
 
-    CCACHE_COMPILER=$COMPILER_BIN $CCACHE /and/even/absolute/compilers \
+    CCACHE_COMPILER=$COMPILER $CCACHE /and/even/absolute/compilers \
         $COMPILER_ARGS -c test1.c
     expect_stat preprocessed_cache_hit 3
     expect_stat cache_miss 1
@@ -1105,7 +1108,7 @@ EOF
 
     echo '#warning This triggers a compiler warning' >stderr.c
 
-    $REAL_COMPILER -Wall -c stderr.c -fsyntax-only 2>reference_stderr.txt
+    $COMPILER -Wall -c stderr.c -fsyntax-only 2>reference_stderr.txt
 
     expect_contains reference_stderr.txt "This triggers a compiler warning"
 
@@ -1156,7 +1159,7 @@ int stderr(void)
   // Trigger warning by having no return statement.
 }
 EOF
-    $REAL_COMPILER -c -Wall -W -c stderr.c 2>reference_stderr.txt
+    $COMPILER -c -Wall -W -c stderr.c 2>reference_stderr.txt
     $CCACHE_COMPILE -Wall -W -c stderr.c 2>stderr.txt
     expect_equal_content reference_stderr.txt stderr.txt
 
@@ -1194,7 +1197,7 @@ EOF
     cat <<EOF >test.c
 #warning Foo
 EOF
-    $REAL_COMPILER -c test.c -MMD 2>reference.stderr
+    $COMPILER -c test.c -MMD 2>reference.stderr
     mv test.d reference.d
 
     $CCACHE_COMPILE -c test.c -MMD 2>test.stderr
index 34e5cb7024b4cf6fde774da275baf0b41c5b5349..e3273f8afeaa45f8b52de9149e5d088a5755a2c6 100644 (file)
@@ -81,7 +81,7 @@ EOF
     ln -s d1/d2 d3
 
     CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/d3/c.c
-    $REAL_COMPILER c.o -o c
+    $COMPILER c.o -o c
     if [ "$(./c)" != OK ]; then
         test_failed "Incorrect header file used"
     fi
@@ -104,7 +104,7 @@ EOF
     ln -s d/c.c c.c
 
     CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/c.c
-    $REAL_COMPILER c.o -o c
+    $COMPILER c.o -o c
     if [ "$(./c)" != OK ]; then
         test_failed "Incorrect header file used"
     fi
@@ -282,7 +282,7 @@ EOF
     backdate test.h
 
     pwd="$(pwd -P)"
-    $REAL_COMPILER -c $pwd/test.c 2>reference.stderr
+    $COMPILER -c $pwd/test.c 2>reference.stderr
 
     CCACHE_ABSSTDERR=1 CCACHE_BASEDIR="$pwd" $CCACHE_COMPILE -c $pwd/test.c 2>ccache.stderr
     expect_stat direct_cache_hit 0
@@ -296,8 +296,8 @@ EOF
     expect_stat cache_miss 1
     expect_equal_content reference.stderr ccache.stderr
 
-    if $REAL_COMPILER -fdiagnostics-color=always -c test.c 2>/dev/null; then
-        $REAL_COMPILER -fdiagnostics-color=always -c $pwd/test.c 2>reference.stderr
+    if $COMPILER -fdiagnostics-color=always -c test.c 2>/dev/null; then
+        $COMPILER -fdiagnostics-color=always -c $pwd/test.c 2>reference.stderr
 
         CCACHE_ABSSTDERR=1 CCACHE_BASEDIR="$pwd" $CCACHE_COMPILE -fdiagnostics-color=always -c $pwd/test.c 2>ccache.stderr
         expect_stat direct_cache_hit 2
index b7264bde5e9cdb0aae36211b6c55df56d9aa0526..004eb15e48cf0000969d9d78b3c0714a30eaa6c1 100644 (file)
@@ -15,9 +15,9 @@ SUITE_color_diagnostics_PROBE() {
     # Probe that real compiler actually supports colored diagnostics.
     if [[ ! $color_diagnostics_enable || ! $color_diagnostics_disable ]]; then
         echo "compiler $COMPILER does not support colored diagnostics"
-    elif ! $REAL_COMPILER $color_diagnostics_enable -E - </dev/null >/dev/null 2>&1; then
+    elif ! $COMPILER $color_diagnostics_enable -E - </dev/null >/dev/null 2>&1; then
         echo "compiler $COMPILER (version: $compiler_version) does not support $color_diagnostics_enable"
-    elif ! $REAL_COMPILER $color_diagnostics_disable -E - </dev/null >/dev/null 2>&1; then
+    elif ! $COMPILER $color_diagnostics_disable -E - </dev/null >/dev/null 2>&1; then
         echo "compiler $COMPILER (version: $compiler_version) does not support $color_diagnostics_disable"
     fi
 }
index f2a83a3aba3af10f6521b5bc7cdc813505a3d2a1..e472b285249e3ca4b02a9a4a53244a0a964c2edb 100644 (file)
@@ -1,12 +1,12 @@
 SUITE_cpp1_PROBE() {
     touch test.c
     if $COMPILER_TYPE_GCC; then
-        if ! $REAL_COMPILER -E -fdirectives-only test.c >&/dev/null; then
+        if ! $COMPILER -E -fdirectives-only test.c >&/dev/null; then
             echo "-fdirectives-only not supported by compiler"
             return
         fi
     elif $COMPILER_TYPE_CLANG; then
-        if ! $REAL_COMPILER -E -frewrite-includes test.c >&/dev/null; then
+        if ! $COMPILER -E -frewrite-includes test.c >&/dev/null; then
             echo "-frewrite-includes not supported by compiler"
             return
         fi
@@ -38,7 +38,7 @@ SUITE_cpp1() {
     # -------------------------------------------------------------------------
     TEST "Base case"
 
-    $REAL_COMPILER $cpp_flag -c -o reference_test1.o test1.c
+    $COMPILER $cpp_flag -c -o reference_test1.o test1.c
 
     $CCACHE_COMPILE $cpp_flag -c test1.c
     expect_stat direct_cache_hit 0
index d0cc264bf4688eb8a1fd1dc670e8f2a244cfac59..5911cf6172b1d2c3fe694d8065df221100910092 100644 (file)
@@ -1,6 +1,6 @@
 SUITE_debug_prefix_map_PROBE() {
     touch test.c
-    if ! $REAL_COMPILER -c -fdebug-prefix-map=old=new test.c 2>/dev/null; then
+    if ! $COMPILER -c -fdebug-prefix-map=old=new test.c 2>/dev/null; then
         echo "-fdebug-prefix-map not supported by compiler"
     fi
 }
index 24944acbc141a8330688dfd85a25b3f7421f6fe0..24d8a827fa5ca1c8e9f03f72a712898f374b895d 100644 (file)
@@ -18,8 +18,8 @@ int test3;
 EOF
     backdate test1.h test2.h test3.h
 
-    $REAL_COMPILER -c -Wp,-MD,expected.d test.c
-    $REAL_COMPILER -c -Wp,-MMD,expected_mmd.d test.c
+    $COMPILER -c -Wp,-MD,expected.d test.c
+    $COMPILER -c -Wp,-MMD,expected_mmd.d test.c
     rm test.o
 
     DEPSFLAGS_REAL="-MP -MMD -MF reference_test.d"
@@ -83,7 +83,7 @@ EOF
 
 generate_reference_compiler_output() {
     rm -f *.o *.d
-    $REAL_COMPILER $DEPFLAGS -c -o test.o test.c
+    $COMPILER $DEPFLAGS -c -o test.o test.c
     mv test.o reference_test.o
     mv test.d reference_test.d
 }
@@ -92,7 +92,7 @@ SUITE_depend() {
     # -------------------------------------------------------------------------
     TEST "Base case"
 
-    $REAL_COMPILER $DEPSFLAGS_REAL -c -o reference_test.o test.c
+    $COMPILER $DEPSFLAGS_REAL -c -o reference_test.o test.c
 
     CCACHE_DEPEND=1 $CCACHE_COMPILE $DEPSFLAGS_CCACHE -c test.c
     expect_equal_object_files reference_test.o test.o
@@ -130,7 +130,7 @@ SUITE_depend() {
     # -------------------------------------------------------------------------
     TEST "No explicit dependency file"
 
-    $REAL_COMPILER $DEPSFLAGS_REAL -c -o reference_test.o test.c
+    $COMPILER $DEPSFLAGS_REAL -c -o reference_test.o test.c
 
     CCACHE_DEPEND=1 $CCACHE_COMPILE -MD -c test.c
     expect_equal_object_files reference_test.o test.o
@@ -166,7 +166,7 @@ int stderr(void)
   // Trigger compiler warning by having no return statement.
 }
 EOF
-    $REAL_COMPILER -MD -Wall -W -c cpp-warning.c 2>stderr-baseline.txt
+    $COMPILER -MD -Wall -W -c cpp-warning.c 2>stderr-baseline.txt
 
     CCACHE_DEPEND=1 $CCACHE_COMPILE -MD -Wall -W -c cpp-warning.c 2>stderr-orig.txt
     expect_stat direct_cache_hit 0
@@ -301,7 +301,7 @@ EOF
     TEST "Source file with special characters"
 
     touch 'file with$special#characters.c'
-    $REAL_COMPILER -MMD -c 'file with$special#characters.c'
+    $COMPILER -MMD -c 'file with$special#characters.c'
     mv 'file with$special#characters.d' reference.d
 
     CCACHE_DEPEND=1 $CCACHE_COMPILE -MMD -c 'file with$special#characters.c'
index 9b54a597461e1244a3263f6d9074ac5e5ab8d39f..c17d8b613074601b4e4075490e0bddb83a464825 100644 (file)
@@ -18,8 +18,8 @@ int test3;
 EOF
     backdate test1.h test2.h test3.h
 
-    $REAL_COMPILER -c -Wp,-MD,expected.d test.c
-    $REAL_COMPILER -c -Wp,-MMD,expected_mmd.d test.c
+    $COMPILER -c -Wp,-MD,expected.d test.c
+    $COMPILER -c -Wp,-MMD,expected_mmd.d test.c
     rm test.o
 }
 
@@ -27,7 +27,7 @@ SUITE_direct() {
     # -------------------------------------------------------------------------
     TEST "Base case"
 
-    $REAL_COMPILER -c -o reference_test.o test.c
+    $COMPILER -c -o reference_test.o test.c
 
     $CCACHE_COMPILE -c test.c
     expect_stat direct_cache_hit 0
@@ -212,10 +212,10 @@ EOF
             TEST "Dependency file content, $dep_args $obj_args"
             # -----------------------------------------------------------------
 
-            $REAL_COMPILER -c test.c $dep_args $obj_args
+            $COMPILER -c test.c $dep_args $obj_args
             mv $dep_file $dep_file.real
 
-            $REAL_COMPILER -c test.c $dep_args -o another.o
+            $COMPILER -c test.c $dep_args -o another.o
             mv $another_dep_file another.d.real
 
             # cache miss
@@ -250,7 +250,7 @@ EOF
                 obj=$dir/$name.o
                 dep=$(echo $obj | sed 's/\.o$/.d/')
 
-                $REAL_COMPILER $option -c test1.c -o $obj
+                $COMPILER $option -c test1.c -o $obj
                 mv $dep orig.d
 
                 $CCACHE_COMPILE $option -c test1.c -o $obj
@@ -277,7 +277,7 @@ EOF
         for name in test2 obj1 obj2; do
             obj=$dir1/$name.o
             dep=$(echo $obj | sed 's/\.o$/.d/')
-            $REAL_COMPILER -MMD -c $src -o $obj
+            $COMPILER -MMD -c $src -o $obj
             mv $dep $orig_dep
             rm $obj
 
@@ -333,7 +333,7 @@ EOF
     expect_stat cache_miss 1
     expect_equal_content other.d expected.d
 
-    $REAL_COMPILER -c -Wp,-MD,other.d test.c -o reference_test.o
+    $COMPILER -c -Wp,-MD,other.d test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
@@ -360,7 +360,7 @@ EOF
     expect_stat cache_miss 1
     expect_equal_content other.d expected_mmd.d
 
-    $REAL_COMPILER -c -Wp,-MMD,other.d test.c -o reference_test.o
+    $COMPILER -c -Wp,-MMD,other.d test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
@@ -447,7 +447,7 @@ EOF
     expect_stat cache_miss 1
     expect_equal_content test.d expected.d
 
-    $REAL_COMPILER -c -MD test.c -o reference_test.o
+    $COMPILER -c -MD test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f test.d
@@ -486,7 +486,7 @@ EOF
 int test() { return 0; }
 EOF
 
-    if $REAL_COMPILER -c -fstack-usage code.c >/dev/null 2>&1; then
+    if $COMPILER -c -fstack-usage code.c >/dev/null 2>&1; then
         $CCACHE_COMPILE -c -fstack-usage code.c
         expect_stat direct_cache_hit 0
         expect_stat preprocessed_cache_hit 0
@@ -510,7 +510,7 @@ EOF
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 1
     expect_equal_content test.d expected.d
-    $REAL_COMPILER -c -MD test.c -o reference_test.o
+    $COMPILER -c -MD test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f test.d
@@ -548,7 +548,7 @@ EOF
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 1
     expect_equal_content other.d expected.d
-    $REAL_COMPILER -c -MD -MF other.d test.c -o reference_test.o
+    $COMPILER -c -MD -MF other.d test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
index 4e510900134fb7a2803ffa0f8c2ebfe52fa8599d..3cfb0c0c2958bc7195a17381fabbd00fc048f39d 100644 (file)
@@ -24,10 +24,10 @@ int test3;
 EOF
     backdate test1.h test2.h test3.h
 
-    DEPENDENCIES_OUTPUT="expected_dependencies_output.d" $REAL_COMPILER -c test.c
-    DEPENDENCIES_OUTPUT="expected_dependencies_output_target.d target.o" $REAL_COMPILER -c test.c
-    SUNPRO_DEPENDENCIES="expected_sunpro_dependencies.d" $REAL_COMPILER -c test.c
-    SUNPRO_DEPENDENCIES="expected_sunpro_dependencies_target.d target.o" $REAL_COMPILER -c test.c
+    DEPENDENCIES_OUTPUT="expected_dependencies_output.d" $COMPILER -c test.c
+    DEPENDENCIES_OUTPUT="expected_dependencies_output_target.d target.o" $COMPILER -c test.c
+    SUNPRO_DEPENDENCIES="expected_sunpro_dependencies.d" $COMPILER -c test.c
+    SUNPRO_DEPENDENCIES="expected_sunpro_dependencies_target.d target.o" $COMPILER -c test.c
     rm test.o
 }
 
@@ -41,7 +41,7 @@ SUITE_direct_gcc() {
     expect_stat cache_miss 1
     expect_equal_content other.d expected_dependencies_output.d
 
-    DEPENDENCIES_OUTPUT="other.d" $REAL_COMPILER -c test.c -o reference_test.o
+    DEPENDENCIES_OUTPUT="other.d" $COMPILER -c test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
@@ -68,7 +68,7 @@ SUITE_direct_gcc() {
     expect_stat cache_miss 1
     expect_equal_content other.d expected_dependencies_output_target.d
 
-    DEPENDENCIES_OUTPUT="other.d target.o" $REAL_COMPILER -c test.c -o reference_test.o
+    DEPENDENCIES_OUTPUT="other.d target.o" $COMPILER -c test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
@@ -95,7 +95,7 @@ SUITE_direct_gcc() {
     expect_stat cache_miss 1
     expect_equal_content other.d expected_sunpro_dependencies.d
 
-    SUNPRO_DEPENDENCIES="other.d" $REAL_COMPILER -c test.c -o reference_test.o
+    SUNPRO_DEPENDENCIES="other.d" $COMPILER -c test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
@@ -122,7 +122,7 @@ SUITE_direct_gcc() {
     expect_stat cache_miss 1
     expect_equal_content other.d expected_sunpro_dependencies_target.d
 
-    SUNPRO_DEPENDENCIES="other.d target.o" $REAL_COMPILER -c test.c -o reference_test.o
+    SUNPRO_DEPENDENCIES="other.d target.o" $COMPILER -c test.c -o reference_test.o
     expect_equal_object_files reference_test.o test.o
 
     rm -f other.d
index 3ae1b462e9a10a9abcd5a73b698493f03d213fbf..25aec4d7cd62f7a23d19d7fb944e2dd1aa65aadb 100644 (file)
@@ -11,7 +11,7 @@ SUITE_fileclone() {
 
     generate_code 1 test.c
 
-    $REAL_COMPILER -c -o reference_test.o test.c
+    $COMPILER -c -o reference_test.o test.c
 
     CCACHE_FILECLONE=1 $CCACHE_COMPILE -c test.c
     expect_stat preprocessed_cache_hit 0
@@ -37,7 +37,7 @@ SUITE_fileclone() {
 
     generate_code 1 test.c
 
-    $REAL_COMPILER -c -o reference_test.o test.c
+    $COMPILER -c -o reference_test.o test.c
 
     $CCACHE_COMPILE -c test.c
     expect_stat preprocessed_cache_hit 0
index 76b0f29483e60f9d9bd36893f9a73cb1198b4787..cf3c5304e3248d90d78d4a17e87b55616302dda4 100644 (file)
@@ -13,7 +13,7 @@ SUITE_hardlink() {
 
     generate_code 1 test1.c
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
     CCACHE_HARDLINK=1 $CCACHE_COMPILE -c test1.c
     expect_stat preprocessed_cache_hit 0
@@ -52,9 +52,9 @@ SUITE_hardlink() {
     TEST "Overwrite assembler"
 
     generate_code 1 test1.c
-    $REAL_COMPILER -S -o test1.s test1.c
+    $COMPILER -S -o test1.s test1.c
 
-    $REAL_COMPILER -c -o reference_test1.o test1.s
+    $COMPILER -c -o reference_test1.o test1.s
 
     CCACHE_HARDLINK=1 $CCACHE_COMPILE -c test1.s
     expect_stat preprocessed_cache_hit 0
@@ -62,7 +62,7 @@ SUITE_hardlink() {
     expect_stat files_in_cache 2
 
     generate_code 2 test1.c
-    $REAL_COMPILER -S -o test1.s test1.c
+    $COMPILER -S -o test1.s test1.c
 
     CCACHE_HARDLINK=1 $CCACHE_COMPILE -c test1.s
     expect_stat preprocessed_cache_hit 0
@@ -70,7 +70,7 @@ SUITE_hardlink() {
     expect_stat files_in_cache 4
 
     generate_code 1 test1.c
-    $REAL_COMPILER -S -o test1.s test1.c
+    $COMPILER -S -o test1.s test1.c
 
     CCACHE_HARDLINK=1 $CCACHE_COMPILE -c test1.s
     expect_stat preprocessed_cache_hit 1
index a7bb40511d3da298d035d1b5d2b34832b8a8127c..833ab3b47af1b70fd2501940f2c9e9b6aba13938 100644 (file)
@@ -1,6 +1,6 @@
 SUITE_input_charset_PROBE() {
     touch test.c
-    if ! $REAL_COMPILER -c -finput-charset=latin1 test.c >/dev/null 2>&1; then
+    if ! $COMPILER -c -finput-charset=latin1 test.c >/dev/null 2>&1; then
         echo "compiler doesn't support -finput-charset"
     fi
 }
index cf371318bf37e52f5019d3878c50d63373d8ae7a..bfba176995f580c371e8c5c1a0f7f8135e8196af 100644 (file)
@@ -19,7 +19,7 @@ SUITE_masquerading() {
     # -------------------------------------------------------------------------
     TEST "Masquerading via symlink, relative path"
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
     ./$COMPILER_BIN $COMPILER_ARGS -c test1.c
     expect_stat preprocessed_cache_hit 0
@@ -36,7 +36,7 @@ SUITE_masquerading() {
     # -------------------------------------------------------------------------
     TEST "Masquerading via symlink, absolute path"
 
-    $REAL_COMPILER -c -o reference_test1.o test1.c
+    $COMPILER -c -o reference_test1.o test1.c
 
     $PWD/$COMPILER_BIN $COMPILER_ARGS -c test1.c
     expect_stat preprocessed_cache_hit 0
index a7cb7bbd6b86fe255b7a8bd367415607ca9c7ee8..d690b19e14d72cf0df5fad2c40ef4765efa7452b 100644 (file)
@@ -9,7 +9,7 @@ SUITE_no_compression() {
     # -------------------------------------------------------------------------
     TEST "Base case"
 
-    $REAL_COMPILER -c -o reference_test.o test.c
+    $COMPILER -c -o reference_test.o test.c
 
     $CCACHE_COMPILE -c test.c
     expect_stat direct_cache_hit 0
index bf435c7181c7de66d6ceeb60a454be515b96df06..8fa090954ed553d8195667099fc9ff80b15dfc79 100644 (file)
@@ -1,7 +1,7 @@
 nvcc_PROBE() {
     if [ -z "$REAL_NVCC" ]; then
         echo "nvcc is not available"
-    elif [ -z "$REAL_CUOBJDUMP" ]; then
+    elif ! command -v cuobjdump >/dev/null; then
         echo "cuobjdump is not available"
     fi
 }
@@ -58,7 +58,7 @@ nvcc_tests() {
     nvcc_opts_gpu2="--generate-code arch=compute_52,code=sm_52"
     ccache_nvcc_cpp="$CCACHE $REAL_NVCC $nvcc_opts_cpp"
     ccache_nvcc_cuda="$CCACHE $REAL_NVCC $nvcc_opts_cuda"
-    cuobjdump="$REAL_CUOBJDUMP -all -elf -symbols -ptx -sass"
+    cuobjdump="cuobjdump -all -elf -symbols -ptx -sass"
 
     # -------------------------------------------------------------------------
     TEST "Simple mode"
@@ -215,17 +215,17 @@ nvcc_tests() {
     # -------------------------------------------------------------------------
     TEST "Option --compiler-bindir"
 
-    $REAL_NVCC $nvcc_opts_cpp --compiler-bindir $REAL_COMPILER_BIN \
+    $REAL_NVCC $nvcc_opts_cpp --compiler-bindir $COMPILER_BIN \
       -o reference_test1.o test_cpp.cu
 
     # First compile.
-    $ccache_nvcc_cpp --compiler-bindir $REAL_COMPILER_BIN test_cpp.cu
+    $ccache_nvcc_cpp --compiler-bindir $COMPILER_BIN test_cpp.cu
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 1
     expect_stat files_in_cache 1
     expect_equal_content reference_test1.o test_cpp.o
 
-    $ccache_nvcc_cpp --compiler-bindir $REAL_COMPILER_BIN test_cpp.cu
+    $ccache_nvcc_cpp --compiler-bindir $COMPILER_BIN test_cpp.cu
     expect_stat preprocessed_cache_hit 1
     expect_stat cache_miss 1
     expect_stat files_in_cache 1
@@ -234,17 +234,17 @@ nvcc_tests() {
     # -------------------------------------------------------------------------
     TEST "Option -ccbin"
 
-    $REAL_NVCC $nvcc_opts_cpp -ccbin $REAL_COMPILER_BIN \
+    $REAL_NVCC $nvcc_opts_cpp -ccbin $COMPILER_BIN \
       -o reference_test1.o test_cpp.cu
 
     # First compile.
-    $ccache_nvcc_cpp -ccbin $REAL_COMPILER_BIN test_cpp.cu
+    $ccache_nvcc_cpp -ccbin $COMPILER_BIN test_cpp.cu
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 1
     expect_stat files_in_cache 1
     expect_equal_content reference_test1.o test_cpp.o
 
-    $ccache_nvcc_cpp -ccbin $REAL_COMPILER_BIN test_cpp.cu
+    $ccache_nvcc_cpp -ccbin $COMPILER_BIN test_cpp.cu
     expect_stat preprocessed_cache_hit 1
     expect_stat cache_miss 1
     expect_stat files_in_cache 1
index 873e659cba4946ea4d7db98e4c6e0fcecb603fa0..0b28d988931376ef6e2aaaa3caabad80501e4a5c 100644 (file)
@@ -20,7 +20,7 @@ SUITE_nvcc_direct() {
     nvcc_opts_gpu2="--generate-code arch=compute_52,code=sm_52"
     ccache_nvcc_cpp="$CCACHE $REAL_NVCC $nvcc_opts_cpp"
     ccache_nvcc_cuda="$CCACHE $REAL_NVCC $nvcc_opts_cuda"
-    cuobjdump="$REAL_CUOBJDUMP -all -elf -symbols -ptx -sass"
+    cuobjdump="cuobjdump -all -elf -symbols -ptx -sass"
 
     # -------------------------------------------------------------------------
     TEST "Simple mode"
index e18c664fc85314a70aa8a38d3a192d448d639280..13177e24083172d97cead8f6d14a6057e4577d7d 100644 (file)
@@ -2,7 +2,7 @@ SUITE_nvcc_ldir_PROBE() {
     if [ -z "$REAL_NVCC" ]; then
         echo "nvcc is not available"
         return
-    elif [ -z "$REAL_CUOBJDUMP" ]; then
+    elif ! command -v cuobjdump >/dev/null; then
         echo "cuobjdump is not available"
         return
     fi
@@ -23,9 +23,9 @@ SUITE_nvcc_ldir_PROBE() {
         echo "include directory $nvcc_idir not found"
     fi
 
-    echo "int main() { return 0; }" | $REAL_NVCC -Wno-deprecated-gpu-targets -ccbin $REAL_COMPILER_BIN -c -x cu - 
+    echo "int main() { return 0; }" | $REAL_NVCC -Wno-deprecated-gpu-targets -ccbin $COMPILER_BIN -c -x cu - 
     if [ $? -ne 0 ]; then
-        echo "nvcc of a canary failed; Is CUDA compatible with the host compiler ($REAL_COMPILER_BIN)?"
+        echo "nvcc of a canary failed; Is CUDA compatible with the host compiler ($COMPILER_BIN)?"
     fi
 }
 
@@ -34,9 +34,9 @@ SUITE_nvcc_ldir_SETUP() {
 }
 
 SUITE_nvcc_ldir() {
-    nvcc_opts_cuda="-Wno-deprecated-gpu-targets -c -ccbin $REAL_COMPILER_BIN"
+    nvcc_opts_cuda="-Wno-deprecated-gpu-targets -c -ccbin $COMPILER_BIN"
     ccache_nvcc_cuda="$CCACHE $REAL_NVCC $nvcc_opts_cuda"
-    cuobjdump="$REAL_CUOBJDUMP -all -elf -symbols -ptx -sass"
+    cuobjdump="cuobjdump -all -elf -symbols -ptx -sass"
     nvcc_dir=$(dirname $REAL_NVCC)
     nvcc_ldir=$nvcc_dir/../nvvm/libdevice
     cicc_path=$nvcc_dir/../nvvm/bin
index ad77c8224d73c5c1f98d8b700436a4d6509eb7e5..ec5fc08ad62037b28a16c5730ffd59d7e513d03d 100644 (file)
@@ -2,13 +2,13 @@ SUITE_pch_PROBE() {
     touch pch.h empty.c
     mkdir dir
 
-    if ! $REAL_COMPILER $SYSROOT -fpch-preprocess pch.h 2>/dev/null \
+    if ! $COMPILER $SYSROOT -fpch-preprocess pch.h 2>/dev/null \
             || [ ! -f pch.h.gch ]; then
         echo "compiler ($($COMPILER --version | head -n 1)) doesn't support precompiled headers"
     fi
 
-    $REAL_COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch 2>/dev/null
-    if ! $REAL_COMPILER $SYSROOT -c -include dir/pch.h empty.c 2>/dev/null; then
+    $COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch 2>/dev/null
+    if ! $COMPILER $SYSROOT -c -include dir/pch.h empty.c 2>/dev/null; then
         echo "compiler ($($COMPILER --version | head -n 1)) seems to have broken support for precompiled headers"
     fi
 }
@@ -121,7 +121,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, #include, remove pch.h"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
     rm pch.h
 
@@ -136,7 +136,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, -include, no sloppiness"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -149,7 +149,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, -include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -164,7 +164,7 @@ pch_suite_common() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -180,7 +180,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, preprocessor mode, -include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch.c
@@ -195,7 +195,7 @@ pch_suite_common() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch.c
@@ -236,7 +236,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, -include, PCH_EXTSUM=1"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     echo "original checksum" > pch.h.gch.sum
@@ -270,7 +270,7 @@ pch_suite_common() {
 
     sleep 1
     touch pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_PCH_EXTSUM=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -281,7 +281,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, -include, no PCH_EXTSUM"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     echo "original checksum" > pch.h.gch.sum
@@ -307,7 +307,7 @@ pch_suite_common() {
     TEST "Use .gch, -include, other dir for .gch"
 
     mkdir -p dir
-    $REAL_COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
+    $COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
     backdate dir/pch.h.gch
     rm -f pch.h.gch
 
@@ -323,7 +323,7 @@ pch_suite_common() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
+    $COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
     backdate dir/pch.h.gch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include dir/pch.h pch2.c
@@ -341,7 +341,7 @@ pch_suite_common() {
     TEST "Use .gch, preprocessor mode, -include, other dir for .gch"
 
     mkdir -p dir
-    $REAL_COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
+    $COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
     backdate dir/pch.h.gch
     rm -f pch.h.gch
 
@@ -357,7 +357,7 @@ pch_suite_common() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
+    $COMPILER $SYSROOT -c pch.h -o dir/pch.h.gch
     backdate dir/pch.h.gch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include dir/pch.h pch.c
@@ -374,7 +374,7 @@ pch_suite_common() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, depend mode, -include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_DEPEND=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c -MD -MF pch.d
@@ -389,7 +389,7 @@ pch_suite_common() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_DEPEND=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c -MD -MF pch.d
@@ -407,7 +407,7 @@ pch_suite_gcc() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, -include, remove pch.h"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
     rm pch.h
 
@@ -424,7 +424,7 @@ pch_suite_gcc() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, #include, no sloppiness"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
     rm pch.h
 
@@ -437,7 +437,7 @@ pch_suite_gcc() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, #include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
     rm pch.h
 
@@ -453,7 +453,7 @@ pch_suite_gcc() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -fpch-preprocess pch.c
@@ -469,7 +469,7 @@ pch_suite_gcc() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, preprocessor mode, #include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
     rm pch.h
 
@@ -485,7 +485,7 @@ pch_suite_gcc() {
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -fpch-preprocess pch.c
@@ -543,7 +543,7 @@ pch_suite_gcc() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, #include, PCH_EXTSUM=1"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     echo "original checksum" > pch.h.gch.sum
@@ -577,7 +577,7 @@ pch_suite_gcc() {
 
     sleep 1
     touch pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     CCACHE_PCH_EXTSUM=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -fpch-preprocess pch.c
@@ -588,7 +588,7 @@ pch_suite_gcc() {
     # -------------------------------------------------------------------------
     TEST "Use .gch, #include, no PCH_EXTSUM"
 
-    $REAL_COMPILER $SYSROOT -c pch.h
+    $COMPILER $SYSROOT -c pch.h
     backdate pch.h.gch
 
     echo "original checksum" > pch.h.gch.sum
@@ -624,7 +624,7 @@ pch_suite_gcc() {
     touch lib.h
     touch main.c
 
-    $REAL_COMPILER $SYSROOT -c lib.h
+    $COMPILER $SYSROOT -c lib.h
     touch -d "@$(($(date +%s) + 60))" lib.h.gch # 1 minute in the future
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS pch_defines,time_macros" $CCACHE_COMPILE -include lib.h -c main.c
@@ -661,7 +661,7 @@ EOF
     expect_stat preprocessed_cache_hit 0
     expect_stat cache_miss 2
 
-    $REAL_COMPILER $SYSROOT -c -include pch2.h pch2.c
+    $COMPILER $SYSROOT -c -include pch2.h pch2.c
     expect_exists pch2.o
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS pch_defines" $CCACHE_COMPILE $SYSROOT -c pch2.h
@@ -672,7 +672,7 @@ EOF
     # -------------------------------------------------------------------------
     TEST "Use .pch, -include, no sloppiness"
 
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -685,7 +685,7 @@ EOF
     # -------------------------------------------------------------------------
     TEST "Use .pch, -include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -700,7 +700,7 @@ EOF
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch2.c
@@ -711,7 +711,7 @@ EOF
     # -------------------------------------------------------------------------
     TEST "Use .pch, preprocessor mode, -include"
 
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch.c
@@ -726,7 +726,7 @@ EOF
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include pch.h pch.c
@@ -742,7 +742,7 @@ EOF
     # -------------------------------------------------------------------------
     TEST "Use .pch, -include-pch"
 
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include-pch pch.h.pch pch2.c
@@ -757,7 +757,7 @@ EOF
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include-pch pch.h.pch pch2.c
@@ -768,7 +768,7 @@ EOF
     # -------------------------------------------------------------------------
     TEST "Use .pch, preprocessor mode, -include-pch"
 
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include-pch pch.h.pch pch.c
@@ -783,7 +783,7 @@ EOF
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -c pch.h -o pch.h.pch
+    $COMPILER $SYSROOT -c pch.h -o pch.h.pch
     backdate pch.h.pch
 
     CCACHE_NODIRECT=1 CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -c -include-pch pch.h.pch pch.c
@@ -823,7 +823,7 @@ EOF
     # -------------------------------------------------------------------------
     TEST "Use .pch the with -Xclang options"
 
-    $REAL_COMPILER $SYSROOT -Xclang -emit-pch -o pch.h.pch -c pch.h
+    $COMPILER $SYSROOT -Xclang -emit-pch -o pch.h.pch -c pch.h
     backdate pch.h.pch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -Xclang -include-pch -Xclang pch.h.pch -Xclang -include -Xclang pch.h -c pch.c
@@ -838,7 +838,7 @@ EOF
 
     echo '#include <string.h> /*change pch*/' >>pch.h
     backdate pch.h
-    $REAL_COMPILER $SYSROOT -Xclang -emit-pch -o pch.h.pch -c pch.h
+    $COMPILER $SYSROOT -Xclang -emit-pch -o pch.h.pch -c pch.h
     backdate pch.h.pch
 
     CCACHE_SLOPPINESS="$DEFAULT_SLOPPINESS time_macros" $CCACHE_COMPILE $SYSROOT -Xclang -include-pch -Xclang pch.h.pch -Xclang -include -Xclang pch.h -c pch.c
index aa0c93ed094ac79222268448a18627086320da84..c1231b0ee600fe660b0eff47679a55742f634f99 100644 (file)
@@ -162,7 +162,7 @@ SUITE_profiling() {
             touch "$dir/test.c"
             find -name '*.gcno' -delete
 
-            $REAL_COMPILER $flag -ftest-coverage -c $dir/test.c -o $dir/test.o
+            $COMPILER $flag -ftest-coverage -c $dir/test.c -o $dir/test.o
             gcno_name=$(find -name '*.gcno')
             rm "$gcno_name"
 
index 8ca4362630406fec4db00d7c26637018f412d6f3..792a4086c5938c5a7079a747d5021507c5a2cb36 100644 (file)
@@ -1,6 +1,6 @@
 SUITE_sanitize_blacklist_PROBE() {
     touch test.c blacklist.txt
-    if ! $REAL_COMPILER -c -fsanitize-blacklist=blacklist.txt \
+    if ! $COMPILER -c -fsanitize-blacklist=blacklist.txt \
          test.c 2>/dev/null; then
         echo "-fsanitize-blacklist not supported by compiler"
     fi
@@ -18,7 +18,7 @@ SUITE_sanitize_blacklist() {
     # -------------------------------------------------------------------------
     TEST "Compile OK"
 
-    $REAL_COMPILER -c -fsanitize-blacklist=blacklist.txt test1.c
+    $COMPILER -c -fsanitize-blacklist=blacklist.txt test1.c
 
     $CCACHE_COMPILE -c -fsanitize-blacklist=blacklist.txt test1.c
     expect_stat direct_cache_hit 0
@@ -45,7 +45,7 @@ SUITE_sanitize_blacklist() {
     # -------------------------------------------------------------------------
     TEST "Unsuccessful compilation"
 
-    if $REAL_COMPILER -c -fsanitize-blacklist=nosuchfile.txt test1.c 2>expected.stderr; then
+    if $COMPILER -c -fsanitize-blacklist=nosuchfile.txt test1.c 2>expected.stderr; then
         test_failed "Expected an error compiling test1.c"
     fi
 
@@ -60,7 +60,7 @@ SUITE_sanitize_blacklist() {
     # -------------------------------------------------------------------------
     TEST "Multiple -fsanitize-blacklist"
 
-    $REAL_COMPILER -c -fsanitize-blacklist=blacklist2.txt -fsanitize-blacklist=blacklist.txt test1.c
+    $COMPILER -c -fsanitize-blacklist=blacklist2.txt -fsanitize-blacklist=blacklist.txt test1.c
 
     $CCACHE_COMPILE -c -fsanitize-blacklist=blacklist2.txt -fsanitize-blacklist=blacklist.txt test1.c
     expect_stat direct_cache_hit 0
index 6163da73ef278f29f34a642f0d0be0ab522208b8..cb6101085402da36779be1b4fb350b7594dc3e01 100644 (file)
@@ -1,6 +1,6 @@
 SUITE_serialize_diagnostics_PROBE() {
     touch test.c
-    if ! $REAL_COMPILER -c --serialize-diagnostics \
+    if ! $COMPILER -c --serialize-diagnostics \
          test1.dia test.c 2>/dev/null; then
         echo "--serialize-diagnostics not supported by compiler"
     fi
@@ -14,7 +14,7 @@ SUITE_serialize_diagnostics() {
     # -------------------------------------------------------------------------
     TEST "Compile OK"
 
-    $REAL_COMPILER -c --serialize-diagnostics expected.dia test1.c
+    $COMPILER -c --serialize-diagnostics expected.dia test1.c
 
     $CCACHE_COMPILE -c --serialize-diagnostics test.dia test1.c
     expect_stat preprocessed_cache_hit 0
@@ -34,7 +34,7 @@ SUITE_serialize_diagnostics() {
     TEST "Unsuccessful compilation"
 
     echo "bad source" >error.c
-    if $REAL_COMPILER -c --serialize-diagnostics expected.dia error.c 2>expected.stderr; then
+    if $COMPILER -c --serialize-diagnostics expected.dia error.c 2>expected.stderr; then
         test_failed "Expected an error compiling error.c"
     fi
 
index c5efdc7af7b35e57439e02de1b6857aabc8741f7..a36bcbcccd7d5e57d148016a2d20e2d4645eba21 100644 (file)
@@ -1,6 +1,6 @@
 SUITE_source_date_epoch_PROBE() {
     echo 'char x[] = __DATE__;' >test.c
-    if ! SOURCE_DATE_EPOCH=0 $REAL_COMPILER -E test.c | grep -q 1970; then
+    if ! SOURCE_DATE_EPOCH=0 $COMPILER -E test.c | grep -q 1970; then
         echo "SOURCE_DATE_EPOCH not supported by compiler"
     fi
 }
index 7b77ca8ebd72dc52240366e1a9d0ad14321f8766..dcbac0b31806f218b49e71f78f2ebe3b7f48176e 100644 (file)
@@ -1,6 +1,6 @@
 SUITE_split_dwarf_PROBE() {
     touch test.c
-    if ! $REAL_COMPILER -c -gsplit-dwarf test.c 2>/dev/null || [ ! -e test.dwo ]; then
+    if ! $COMPILER -c -gsplit-dwarf test.c 2>/dev/null || [ ! -e test.dwo ]; then
         echo "-gsplit-dwarf not supported by compiler"
     elif ! $COMPILER -fdebug-prefix-map=a=b -c test.c 2>/dev/null; then
         echo "-fdebug-prefix-map not supported by compiler"
@@ -50,11 +50,11 @@ SUITE_split_dwarf() {
 
     cd dir1
 
-    $REAL_COMPILER -I$(pwd)/include -c src/test.c -o test.o -gsplit-dwarf
+    $COMPILER -I$(pwd)/include -c src/test.c -o test.o -gsplit-dwarf
     mv test.o reference.o
     mv test.dwo reference.dwo
 
-    $REAL_COMPILER -I$(pwd)/include -c src/test.c -o test.o -gsplit-dwarf
+    $COMPILER -I$(pwd)/include -c src/test.c -o test.o -gsplit-dwarf
     mv test.o reference2.o
     mv test.dwo reference2.dwo
 
@@ -75,7 +75,7 @@ SUITE_split_dwarf() {
         expect_stat cache_miss 1
         expect_stat files_in_cache 2
 
-        $REAL_COMPILER -I$(pwd)/include -c src/test.c -o test2.o -gsplit-dwarf
+        $COMPILER -I$(pwd)/include -c src/test.c -o test2.o -gsplit-dwarf
         mv test2.o reference2.o
         mv test2.dwo reference2.dwo
 
@@ -124,7 +124,7 @@ SUITE_split_dwarf() {
     # "gcc -gsplit-dwarf -g1" produces a .dwo file, but "clang -gsplit-dwarf
     # -g1" doesn't, so test that ccache handles it gracefully either way.
 
-    $REAL_COMPILER -gsplit-dwarf -g1 -c test.c -o reference.o
+    $COMPILER -gsplit-dwarf -g1 -c test.c -o reference.o
 
     $CCACHE_COMPILE -gsplit-dwarf -g1 -c test.c
     expect_stat direct_cache_hit 0