aboutsummaryrefslogtreecommitdiff
path: root/gcc/coverage.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/coverage.c')
-rw-r--r--gcc/coverage.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/coverage.c b/gcc/coverage.c
index 30ae84d..45c0278 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -49,6 +49,7 @@ along with GCC; see the file COPYING3. If not see
#include "intl.h"
#include "auto-profile.h"
#include "profile.h"
+#include "diagnostic.h"
#include "gcov-io.c"
@@ -1221,6 +1222,19 @@ coverage_init (const char *filename)
const char *separator = "/";
#endif
filename = concat (getpwd (), separator, filename, NULL);
+ if (profile_prefix_path)
+ {
+ if (!strncmp (filename, profile_prefix_path,
+ strlen (profile_prefix_path)))
+ {
+ filename += strlen (profile_prefix_path);
+ while (*filename == *separator)
+ filename++;
+ }
+ else
+ warning (0, "filename %qs does not start with profile "
+ "prefix %qs", filename, profile_prefix_path);
+ }
filename = mangle_path (filename);
len = strlen (filename);
}