[compiler-rt] r242677 - [asan] Speed up ASan unit tests by turning off symbolication

Kuba Brecka kuba.brecka at gmail.com
Mon Jul 20 08:03:39 PDT 2015


Author: kuba.brecka
Date: Mon Jul 20 10:03:39 2015
New Revision: 242677

URL: http://llvm.org/viewvc/llvm-project?rev=242677&view=rev
Log:
[asan] Speed up ASan unit tests by turning off symbolication

ASan unit tests don't depend on the symbolizer and they never test its output, but currently they still run it for every crash. This patch simply disables the symbolizer for unit tests, which provides some speed up. On my system (OS X) that's about 1.4x faster, but this could be potentially much more e.g. when using atos on OS X.

Differential Revision: http://reviews.llvm.org/D11353


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

Modified: compiler-rt/trunk/lib/asan/tests/asan_test_main.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/tests/asan_test_main.cc?rev=242677&r1=242676&r2=242677&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/tests/asan_test_main.cc (original)
+++ compiler-rt/trunk/lib/asan/tests/asan_test_main.cc Mon Jul 20 10:03:39 2015
@@ -12,6 +12,12 @@
 //===----------------------------------------------------------------------===//
 #include "asan_test_utils.h"
 
+// Default ASAN_OPTIONS for the unit tests. Let's turn symbolication off to
+// speed up testing (unit tests don't use it anyway).
+extern "C" const char* __asan_default_options() {
+  return "symbolize=false";
+}
+
 int main(int argc, char **argv) {
   testing::GTEST_FLAG(death_test_style) = "threadsafe";
   testing::InitGoogleTest(&argc, argv);





More information about the llvm-commits mailing list