[PATCH] D24699: [asan] Allow re-exec in instrumented unit tests on Darwin (fix unit tests on macOS <=10.10)

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 29 16:56:11 PST 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL288224: [asan] Allow re-exec in instrumented unit tests on Darwin (fix unit tests on… (authored by kuba.brecka).

Changed prior to commit:
  https://reviews.llvm.org/D24699?vs=78064&id=79677#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D24699

Files:
  compiler-rt/trunk/lib/asan/tests/asan_test_main.cc


Index: compiler-rt/trunk/lib/asan/tests/asan_test_main.cc
===================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_main.cc
+++ compiler-rt/trunk/lib/asan/tests/asan_test_main.cc
@@ -28,9 +28,18 @@
 
 namespace __sanitizer {
 bool ReexecDisabled() {
+#if __has_feature(address_sanitizer) && SANITIZER_MAC
+  // Allow re-exec in instrumented unit tests on Darwin.  Technically, we only
+  // need this for 10.10 and below, where re-exec is required for the
+  // interceptors to work, but to avoid duplicating the version detection logic,
+  // let's just allow re-exec for all Darwin versions.  On newer OS versions,
+  // returning 'false' doesn't do anything anyway, because we don't re-exec.
+  return false;
+#else
   return true;
+#endif
 }
-}
+}  // namespace __sanitizer
 
 int main(int argc, char **argv) {
   testing::GTEST_FLAG(death_test_style) = "threadsafe";


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D24699.79677.patch
Type: text/x-patch
Size: 929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161130/ee54fa21/attachment.bin>


More information about the llvm-commits mailing list