[ubsan] Make suppressions.cpp test pass for me on Windows

The test seems to be failing because the module suppression file
contains a colon. I found that it was sufficient to just use the
basename of the suppression file.

While I was here, I noticed that we don't implement IsAbsolutePath for
Windows, so I added it.

llvm-svn: 352921
This commit is contained in:
Reid Kleckner 2019-02-01 21:35:17 +00:00
parent afc24ed21a
commit 33706e3cbf
2 changed files with 11 additions and 2 deletions

View File

@ -486,8 +486,14 @@ bool IsPathSeparator(const char c) {
return c == '\\' || c == '/';
}
static bool IsAlpha(char c) {
c = ToLower(c);
return c >= 'a' && c <= 'z';
}
bool IsAbsolutePath(const char *path) {
UNIMPLEMENTED();
return path != nullptr && IsAlpha(path[0]) && path[1] == ':' &&
IsPathSeparator(path[2]);
}
void SleepForSeconds(int seconds) {

View File

@ -15,7 +15,10 @@
// RUN: echo "unsigned-integer-overflow:do_overflow" > %t.func-supp
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.func-supp"' %run %t
// RUN: echo "unsigned-integer-overflow:%t" > %t.module-supp
// FIXME: The '%t' substitution can't be used for the module name because it
// contains a colon, so we have to use the basename, which is
// suppressions.cpp.tmp.
// RUN: echo "unsigned-integer-overflow:suppressions.cpp.tmp" > %t.module-supp
// RUN: %env_ubsan_opts=halt_on_error=1:suppressions='"%t.module-supp"' %run %t
// Note: file-level suppressions should work even without debug info.