tsan: fix test
authorDmitry Vyukov <dvyukov@google.com>
Fri, 5 Dec 2014 15:42:17 +0000 (15:42 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Fri, 5 Dec 2014 15:42:17 +0000 (15:42 +0000)
this test is flaky because of ASLR
app memory is 7e8000000000-800000000000,
there may or may not be a 1TB hole depending on
where ASLR will choose to map libraries

llvm-svn: 223469

compiler-rt/test/tsan/mmap_large.cc

index 44233b0..e715ea6 100644 (file)
@@ -1,10 +1,11 @@
 // RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s
 #include <stdint.h>
 #include <stdio.h>
+#include <errno.h>
 #include <sys/mman.h>
 
 int main() {
-  const size_t kLog2Size = 40;
+  const size_t kLog2Size = 39;
   const uintptr_t kLocation = 0x40ULL << kLog2Size;
   void *p = mmap(
       reinterpret_cast<void*>(kLocation),
@@ -12,7 +13,7 @@ int main() {
       PROT_READ|PROT_WRITE,
       MAP_PRIVATE|MAP_ANONYMOUS|MAP_NORESERVE,
       -1, 0);
-  fprintf(stderr, "DONE %p\n", p);
+  fprintf(stderr, "DONE %p %d\n", p, errno);
   return p == MAP_FAILED;
 }