Add test that -fpch-preprocess is added when using -include

This commit is contained in:
Joel Rosdahl 2010-08-28 16:46:32 +02:00
parent e8d8daa112
commit 1928d4d10c

19
test.sh
View File

@ -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