From 1928d4d10cf836a9c855825f9d201f8f40681e1e Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sat, 28 Aug 2010 16:46:32 +0200 Subject: [PATCH] Add test that -fpch-preprocess is added when using -include --- test.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test.sh b/test.sh index a16874bd1..eea318b03 100755 --- a/test.sh +++ b/test.sh @@ -1608,6 +1608,14 @@ EOF cat <pch.h #include EOF + cat <pch2.c +int main() +{ + void *p = NULL; + return 0; +} +EOF + if $COMPILER -fpch-preprocess pch.h 2>/dev/null && [ -f pch.h.gch ] && $COMPILER pch.c -o pch; then : else @@ -1662,6 +1670,17 @@ EOF checkstat 'cache miss' 0 checkstat 'preprocessor error' 1 + testname="no -fpch-preprocess, using -include" + $CCACHE -z >/dev/null + $CCACHE $COMPILER -c -include pch.h pch2.c 2>/dev/null + checkstat 'cache hit (direct)' 0 + checkstat 'cache hit (preprocessed)' 0 + checkstat 'cache miss' 1 + $CCACHE $COMPILER -c -include pch.h pch2.c 2>/dev/null + checkstat 'cache hit (direct)' 1 + checkstat 'cache hit (preprocessed)' 0 + checkstat 'cache miss' 1 + testname="-fpch-preprocess, no sloppy time macros" $CCACHE -z >/dev/null $CCACHE $COMPILER -c -fpch-preprocess pch.c -- 2.47.3