[PATCH] D22257: [compiler-rt] Disable a test failing on windows.

Etienne Bergeron via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 11 22:33:34 PDT 2016


etienneb created this revision.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, wang0109, llvm-commits.
Herald added a subscriber: kubabrecka.

The unittest is not working on windows. The "regexp.h" is not available and
gtest-port won't support regexp with operator '|'.

The test wasn't failing on 32-bits because of this check:
```
  if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return;
```

```
[ RUN      ] AddressSanitizer.HugeMallocTest
C:/src/llvm/llvm/utils/unittest/googletest\src/gtest-port.cc(272): error: Failed
Syntax error at index 30 in simple regular expression "is located 1 bytes to the left|AddressSanitizer failed to allocate": '|' is unsupported.
C:/src/llvm/llvm/projects/compiler-rt/lib/asan/tests/asan_test.cc(308): error: Death test: Ident((char*)malloc(n_megs << 20))[-1] = 0
    Result: died but not with expected error.
  Expected: is located 1 bytes to the left|AddressSanitizer failed to allocate
```

See gtest-port.h:
```
  #elif GTEST_OS_WINDOWS

// <regex.h> is not available on Windows.  Use our own simple regex
// implementation instead.
# define GTEST_USES_SIMPLE_RE 1
```

http://reviews.llvm.org/D22257

Files:
  lib/asan/tests/asan_test.cc

Index: lib/asan/tests/asan_test.cc
===================================================================
--- lib/asan/tests/asan_test.cc
+++ lib/asan/tests/asan_test.cc
@@ -300,13 +300,15 @@
   }
 }
 
+#if !GTEST_USES_SIMPLE_RE
 TEST(AddressSanitizer, HugeMallocTest) {
   if (SANITIZER_WORDSIZE != 64 || ASAN_AVOID_EXPENSIVE_TESTS) return;
   size_t n_megs = 4100;
   EXPECT_DEATH(Ident((char*)malloc(n_megs << 20))[-1] = 0,
                "is located 1 bytes to the left|"
                "AddressSanitizer failed to allocate");
 }
+#endif
 
 #if SANITIZER_TEST_HAS_MEMALIGN
 void MemalignRun(size_t align, size_t size, int idx) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22257.63638.patch
Type: text/x-patch
Size: 632 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160712/dd36b420/attachment.bin>


More information about the llvm-commits mailing list