[compiler-rt] r223469 - tsan: fix test
Dmitry Vyukov
dvyukov at google.com
Fri Dec 5 07:42:17 PST 2014
Author: dvyukov
Date: Fri Dec 5 09:42:17 2014
New Revision: 223469
URL: http://llvm.org/viewvc/llvm-project?rev=223469&view=rev
Log:
tsan: fix test
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
Modified:
compiler-rt/trunk/test/tsan/mmap_large.cc
Modified: compiler-rt/trunk/test/tsan/mmap_large.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/tsan/mmap_large.cc?rev=223469&r1=223468&r2=223469&view=diff
==============================================================================
--- compiler-rt/trunk/test/tsan/mmap_large.cc (original)
+++ compiler-rt/trunk/test/tsan/mmap_large.cc Fri Dec 5 09:42:17 2014
@@ -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;
}
More information about the llvm-commits
mailing list