From 15d15dc8208ebb4dbb6c9130ad022cba21d591b2 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 14 May 2018 18:53:13 +0000 Subject: Revert "[sanitizer] Intercept __pthread_mutex_lock and __pthread_mutex_unlock" Tsan tests fail. This reverts commit r332268 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@332276 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../TestCases/Linux/pthread_mutex.cc | 34 ---------------------- 1 file changed, 34 deletions(-) delete mode 100644 test/sanitizer_common/TestCases/Linux/pthread_mutex.cc (limited to 'test') diff --git a/test/sanitizer_common/TestCases/Linux/pthread_mutex.cc b/test/sanitizer_common/TestCases/Linux/pthread_mutex.cc deleted file mode 100644 index 610958143..000000000 --- a/test/sanitizer_common/TestCases/Linux/pthread_mutex.cc +++ /dev/null @@ -1,34 +0,0 @@ -// RUN: %clangxx -O1 %s -o %t && %run %t -// RUN: %clangxx -O1 -DUSE_GLIBC %s -o %t && %run %t -// UNSUPPORTED: android - -#include - -#ifdef USE_GLIBC -extern "C" int __pthread_mutex_lock(pthread_mutex_t *__mutex); -extern "C" int __pthread_mutex_unlock(pthread_mutex_t *__mutex); -#define LOCK __pthread_mutex_lock -#define UNLOCK __pthread_mutex_unlock -#else -#define LOCK pthread_mutex_lock -#define UNLOCK pthread_mutex_unlock -#endif - -pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; -int x; - -static void *Start(void *arg) { - LOCK(&m); - ++x; - UNLOCK(&m); - return nullptr; -} - -int main() { - pthread_t threads[2] = {}; - for (pthread_t &t : threads) - pthread_create(&t, 0, &Start, 0); - for (pthread_t &t : threads) - pthread_join(t, 0); - return 0; -} -- cgit v1.2.3