From 0d06da7803c082b43cdccfcdfd56911ba4e7d458 Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 22 Feb 2020 22:18:48 +0100 Subject: [PATCH] Add pch test suite probe for seemingly broken compiler support This fixes a problem mentioned by Orion Poplawski in a comment to PR #217. --- test/suites/pch.bash | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) 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 } -- 2.47.2