Fixes #914.
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
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
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
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; }
green PASSED
exit 0
fi
-
# -------------------------------------------------------------------------
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
# 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
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
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"
// 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
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
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
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
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
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
# 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
}
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
# -------------------------------------------------------------------------
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
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
}
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"
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
}
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
// 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
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'
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
}
# -------------------------------------------------------------------------
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
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
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
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
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
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
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
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
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
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
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
}
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
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
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
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
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
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
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
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
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
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
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
}
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
}
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"
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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"
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
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
}
}
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
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
}
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
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
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
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
TEST "Use .gch, #include, no sloppiness"
- $REAL_COMPILER $SYSROOT -c pch.h
+ $COMPILER $SYSROOT -c pch.h
backdate pch.h.gch
rm pch.h
# -------------------------------------------------------------------------
TEST "Use .gch, #include"
- $REAL_COMPILER $SYSROOT -c pch.h
+ $COMPILER $SYSROOT -c pch.h
backdate pch.h.gch
rm pch.h
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
# -------------------------------------------------------------------------
TEST "Use .gch, preprocessor mode, #include"
- $REAL_COMPILER $SYSROOT -c pch.h
+ $COMPILER $SYSROOT -c pch.h
backdate pch.h.gch
rm pch.h
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
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"
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
# -------------------------------------------------------------------------
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
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
# -------------------------------------------------------------------------
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
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
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
}
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"
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
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
# "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