hanchenye-llvm-project/compiler-rt/test
Rainer Orth 1876e6c83c [builtins][test] Avoid unportable mmap call in clear_cache_test.c
Within the last two weeks, the Builtins-*-sunos :: clear_cache_test.c started to FAIL
on Solaris.  Running it under truss shows

  mmap(0x00000000, 128, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, 0, 0) Err#22 EINVAL
  _exit(1)

While there are several possible reasons mmap can return EINVAL on Solaris, it turns
out it's this one (from mmap(2)):

  MAP_ANON  was  specified,  but the file descriptor was not
   -1.

And indeed even the Linux mmap(2) documents this as unportable:

  MAP_ANONYMOUS
          The mapping is not backed by any file; its contents are initial‐
          ized to zero.  The fd argument is ignored; however, some  imple‐
          mentations require fd to be -1 if MAP_ANONYMOUS (or MAP_ANON) is
          specified, and portable applications should  ensure  this.   The

This patch follows this advise.  Tested on x86_64-pc-linux-gnu, amd64-pc-solaris2.11
and sparcv9-sun-solaris2.11.

Differential Revision: https://reviews.llvm.org/D68455

llvm-svn: 375490
2019-10-22 08:44:25 +00:00
..
BlocksRuntime Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan [asan] Update Windows test expectations for LLVM's MS demangler 2019-10-17 17:59:11 +00:00
builtins [builtins][test] Avoid unportable mmap call in clear_cache_test.c 2019-10-22 08:44:25 +00:00
cfi CFI: wrong type passed to llvm.type.test with multiple inheritance devirtualization. 2019-10-15 16:32:50 +00:00
crt compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
dfsan compiler-rt: Rename .cc file in test/dfsan to cpp 2019-08-05 13:19:28 +00:00
fuzzer [CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #3. 2019-10-01 23:08:18 +00:00
gwp_asan compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
hwasan [hwasan] Workaround unwinder issues in try-catch test. 2019-10-21 23:57:12 +00:00
interception [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
lsan [lsan] Fix deadlock in dl_iterate_phdr. 2019-09-19 19:52:57 +00:00
msan [msan] Intercept __getrlimit. 2019-09-30 17:49:48 +00:00
profile [profile] Use -fPIC -shared in a test instead of -dynamiclib 2019-10-19 00:51:27 +00:00
safestack compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
sanitizer_common Add a missing include in test. 2019-10-10 20:47:22 +00:00
scudo compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
shadowcallstack compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
tsan [CMake] Fix the value of `config.target_cflags` for non-macOS Apple platforms. Attempt #3. 2019-10-01 23:08:18 +00:00
ubsan [UBSan] Split nullptr-and-nonzero-offset-variable.c in another direction 2019-10-10 11:03:41 +00:00
ubsan_minimal [UBSan][clang][compiler-rt] Applying non-zero offset to nullptr is undefined behaviour 2019-10-10 09:25:02 +00:00
xray [XRay] Fixing one test case for FreeBSD 2019-08-28 14:18:05 +00:00
.clang-format [compiler-rt] Use "ColumnLimit: 0" instead of "clang-format off" in tests 2018-12-01 01:24:29 +00:00
CMakeLists.txt [compiler-rt] Run cpplint only for check-sanitizer 2019-09-12 01:35:11 +00:00
lit.common.cfg.py compiler-rt: Rename cc files below test/asan to cpp 2019-08-05 16:48:12 +00:00
lit.common.configured.in [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00