]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Add test that -fpch-preprocess is added when using -include
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 28 Aug 2010 14:46:32 +0000 (16:46 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 28 Aug 2010 14:46:32 +0000 (16:46 +0200)
test.sh

diff --git a/test.sh b/test.sh
index a16874bd1db80a205dc6b0f5e8cd5207ce6cbe99..eea318b03c745a75fec10f8378751f69ba36d20d 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1608,6 +1608,14 @@ EOF
     cat <<EOF >pch.h
 #include <stdlib.h>
 EOF
+    cat <<EOF >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