diff options
Diffstat (limited to 'test.sh')
-rwxr-xr-x | test.sh | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -1323,6 +1323,32 @@ SUITE_debug_prefix_map() { if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then test_failed "Source dir (`pwd`) found in test.o" fi + + # ------------------------------------------------------------------------- + TEST "Multiple -fdebug-prefix-map" + + cd dir1 + CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`/include -g -fdebug-prefix-map=`pwd`=foobar -fdebug-prefix-map=foo=bar -c `pwd`/src/test.c -o `pwd`/test.o + expect_stat 'cache hit (direct)' 0 + expect_stat 'cache hit (preprocessed)' 0 + expect_stat 'cache miss' 1 + expect_stat 'files in cache' 2 + if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then + test_failed "Source dir (`pwd`) found in test.o" + fi + if ! grep "foobar" test.o >/dev/null 2>&1; then + test_failed "Relocation (foobar) not found in test.o" + fi + + cd ../dir2 + CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`/include -g -fdebug-prefix-map=`pwd`=foobar -fdebug-prefix-map=foo=bar -c `pwd`/src/test.c -o `pwd`/test.o + expect_stat 'cache hit (direct)' 1 + expect_stat 'cache hit (preprocessed)' 0 + expect_stat 'cache miss' 1 + expect_stat 'files in cache' 2 + if grep -E "[^=]`pwd`[^=]" test.o >/dev/null 2>&1; then + test_failed "Source dir (`pwd`) found in test.o" + fi } # ============================================================================= |