From: Joel Rosdahl Date: Sat, 22 Feb 2020 21:18:48 +0000 (+0100) Subject: Add pch test suite probe for seemingly broken compiler support X-Git-Tag: v3.7.8~7 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2651f37dc24a6829ab785bd6ac885b8bccedfce;p=thirdparty%2Fccache.git Add pch test suite probe for seemingly broken compiler support This fixes a problem mentioned by Orion Poplawski in a comment to PR #217. (cherry picked from commit 0d06da7803c082b43cdccfcdfd56911ba4e7d458) --- diff --git a/test/suites/pch.bash b/test/suites/pch.bash index caf82c459..f779a36f6 100644 --- a/test/suites/pch.bash +++ b/test/suites/pch.bash @@ -1,8 +1,15 @@ SUITE_pch_PROBE() { - touch pch.h + touch pch.h empty.c + mkdir dir + if ! $REAL_COMPILER $SYSROOT -fpch-preprocess pch.h 2>/dev/null \ || [ ! -f pch.h.gch ]; then - echo "compiler ($($COMPILER --version | head -1)) doesn't support precompiled headers" + 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 + echo "compiler ($($COMPILER --version | head -n 1)) seems to have broken support for precompiled headers" fi }