Try to fix OOB tests more on Windows after r367642
authorNico Weber <nicolasweber@gmx.de>
Mon, 5 Aug 2019 15:10:15 +0000 (15:10 +0000)
committerNico Weber <nicolasweber@gmx.de>
Mon, 5 Aug 2019 15:10:15 +0000 (15:10 +0000)
See PR42868 for more details.

The affected list of tests is:

Failing Tests (8):
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.LargeOOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.OOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.OOB_char
    AddressSanitizer-Unit :: ./Asan-x86_64-calls-Test.exe/AddressSanitizer.OOB_int
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.LargeOOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.OOBRightTest
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.OOB_char
    AddressSanitizer-Unit :: ./Asan-x86_64-inline-Test.exe/AddressSanitizer.OOB_int

llvm-svn: 367874

compiler-rt/lib/asan/tests/asan_oob_test.cpp

index 421bd04..6b178b5 100644 (file)
@@ -36,8 +36,15 @@ static std::string GetLeftOOBMessage(int off) {
 
 static std::string GetRightOOBMessage(int off) {
   char str[100];
+#if !defined(_WIN32)
   // FIXME: Fix PR42868 and remove SEGV match.
   sprintf(str, "is located.*%d byte.*to the right|SEGV", off);
+#else
+  // `|` doesn't work in googletest's regexes on Windows,
+  // see googletest/docs/advanced.md#regular-expression-syntax
+  // But it's not needed on Windows anyways.
+  sprintf(str, "is located.*%d byte.*to the right", off);
+#endif
   return str;
 }