summaryrefslogtreecommitdiff
path: root/test.sh
diff options
context:
space:
mode:
Diffstat (limited to 'test.sh')
-rwxr-xr-xtest.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/test.sh b/test.sh
index b4c95b1a..89642e2b 100755
--- a/test.sh
+++ b/test.sh
@@ -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
}
# =============================================================================