[llvm-commits] [compiler-rt] r172063 - /compiler-rt/trunk/lib/sanitizer_common/tests/standalone_malloc_test.cc

Kostya Serebryany kcc at google.com
Thu Jan 10 05:05:17 PST 2013


Author: kcc
Date: Thu Jan 10 07:05:16 2013
New Revision: 172063

URL: http://llvm.org/viewvc/llvm-project?rev=172063&view=rev
Log:
[sanitizer] fix the non-cmake build

Modified:
    compiler-rt/trunk/lib/sanitizer_common/tests/standalone_malloc_test.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/tests/standalone_malloc_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/standalone_malloc_test.cc?rev=172063&r1=172062&r2=172063&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/standalone_malloc_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/standalone_malloc_test.cc Thu Jan 10 07:05:16 2013
@@ -10,7 +10,7 @@
 const size_t kNumIters = 1 << 20;
 
 
-void *MallocThread(void *t) {
+static void *MallocThread(void *t) {
   size_t total_malloced = 0, total_freed = 0;
   size_t max_in_use = 0;
   size_t tid = reinterpret_cast<size_t>(t);
@@ -48,8 +48,8 @@
   return 0;
 }
 
-
-int main() {
+// Build with -Dstandalone_malloc_test=main to make it a separate program.
+int standalone_malloc_test() {
   pthread_t t[kNumThreds];
   for (size_t i = 0; i < kNumThreds; i++)
     pthread_create(&t[i], 0, MallocThread, reinterpret_cast<void *>(i));





More information about the llvm-commits mailing list