[PATCH] D14636: [tsan] Port test/tsan/bench.h to Darwin

Dmitry Vyukov via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 13 02:14:56 PST 2015


dvyukov added inline comments.

================
Comment at: test/tsan/barrier.cc:5
@@ -4,6 +4,3 @@
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <pthread.h>
-#include <unistd.h>
+#include "test.h"
 
----------------
What's the point of testing our own implementation of barrier that nobody else uses (and so it's correctness is actually irrelevant)? We are not trying to re-implement on linux all darwin synchronization primitives like GCD, right. Can we just use the UNSUPPORTED directive, of if that does not work ifdef it out?


================
Comment at: test/tsan/test.h:119
@@ +118,3 @@
+
+#define BENCH_STOPWATCH_START() \
+  unsigned long long tp0 = darwin_uptime()
----------------
I don't see a need for macros here. Please wrap it into functions with iface along the lines of:

typedef ... benchtime_t;
void bench_start(benchtime_t*);
unsigned long long bench_end(benchtime_t);



http://reviews.llvm.org/D14636





More information about the llvm-commits mailing list