Attempt to fix MSAN failures in benchmarks
authorEric Fiselier <eric@efcs.ca>
Wed, 21 Aug 2019 00:14:48 +0000 (00:14 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 21 Aug 2019 00:14:48 +0000 (00:14 +0000)
llvm-svn: 369482

libcxx/benchmarks/algorithms.bench.cpp

index eee8a4d..f5f0a02 100644 (file)
@@ -256,7 +256,13 @@ int main(int argc, char** argv) {
     return 1;
 
   const std::vector<size_t> Quantities = {1 << 0, 1 << 2,  1 << 4,  1 << 6,
-                                          1 << 8, 1 << 10, 1 << 14, 1 << 18};
+                                          1 << 8, 1 << 10, 1 << 14,
+    // Running each benchmark in parallel consumes too much memory with MSAN
+    // and can lead to the test process being killed.
+#if !TEST_HAS_FEATURE(memory_sanitizer)
+                                          1 << 18
+#endif
+  };
   makeCartesianProductBenchmark<Sort, AllValueTypes, AllOrders>(Quantities);
   makeCartesianProductBenchmark<StableSort, AllValueTypes, AllOrders>(
       Quantities);