summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-05-28 13:13:30 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-05-28 13:13:30 +0000
commit13c5ce2e9719dfa2b43b55aa3f6c5716283249e0 (patch)
treeab7620a570cfa4ae5ca10cc2c9fdbdf555befe3c /test
parent7c6aa8557673786a7f6dfc2ea3bfbe8bf3061662 (diff)
[sanitizer] Replace -lpthread with -pthread in tests.
-lpthread does not work on Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@209735 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/Linux/stress_dtls.c4
-rw-r--r--test/asan/TestCases/Linux/tsd_dtor_leak.cc2
-rw-r--r--test/asan/TestCases/Linux/uar_signals.cc2
-rw-r--r--test/asan/TestCases/Linux/unpoison_tls.cc2
-rw-r--r--test/asan/TestCases/Posix/init-order-dlopen.cc4
-rw-r--r--test/asan/TestCases/current_allocated_bytes.cc4
-rw-r--r--test/asan/TestCases/deep_thread_stack.cc8
-rw-r--r--test/asan/TestCases/gc-test.cc2
-rw-r--r--test/asan/TestCases/init-order-pthread-create.cc2
-rw-r--r--test/asan/TestCases/stack-overflow.cc24
-rw-r--r--test/asan/TestCases/stack-use-after-return.cc12
-rw-r--r--test/asan/lit.cfg2
-rw-r--r--test/tsan/lit.cfg2
-rwxr-xr-xtest/tsan/test_output.sh2
14 files changed, 36 insertions, 36 deletions
diff --git a/test/asan/TestCases/Linux/stress_dtls.c b/test/asan/TestCases/Linux/stress_dtls.c
index 814adf3e8..cb901ee59 100644
--- a/test/asan/TestCases/Linux/stress_dtls.c
+++ b/test/asan/TestCases/Linux/stress_dtls.c
@@ -9,7 +9,7 @@
// RUN: %clangxx_asan -x c -DSO_NAME=f0 %s -shared -o %t-f0.so -fPIC
// RUN: %clangxx_asan -x c -DSO_NAME=f1 %s -shared -o %t-f1.so -fPIC
// RUN: %clangxx_asan -x c -DSO_NAME=f2 %s -shared -o %t-f2.so -fPIC
-// RUN: %clangxx_asan %s -ldl -lpthread -o %t
+// RUN: %clangxx_asan %s -ldl -pthread -o %t
// RUN: %run %t 0 3
// RUN: %run %t 2 3
// RUN: ASAN_OPTIONS=verbosity=2 %run %t 10 2 2>&1 | FileCheck %s
@@ -31,7 +31,7 @@
/*
cc=your-compiler
-$cc stress_dtls.c -lpthread -ldl
+$cc stress_dtls.c -pthread -ldl
for((i=0;i<100;i++)); do
$cc -fPIC -shared -DSO_NAME=f$i -o a.out-f$i.so stress_dtls.c;
done
diff --git a/test/asan/TestCases/Linux/tsd_dtor_leak.cc b/test/asan/TestCases/Linux/tsd_dtor_leak.cc
index fdac964bf..221f6accd 100644
--- a/test/asan/TestCases/Linux/tsd_dtor_leak.cc
+++ b/test/asan/TestCases/Linux/tsd_dtor_leak.cc
@@ -1,6 +1,6 @@
// Regression test for a leak in tsd:
// https://code.google.com/p/address-sanitizer/issues/detail?id=233
-// RUN: %clangxx_asan -O1 %s -lpthread -o %t
+// RUN: %clangxx_asan -O1 %s -pthread -o %t
// RUN: ASAN_OPTIONS=quarantine_size=1 %run %t
#include <pthread.h>
#include <stdio.h>
diff --git a/test/asan/TestCases/Linux/uar_signals.cc b/test/asan/TestCases/Linux/uar_signals.cc
index 3c50fcfd1..94e603a49 100644
--- a/test/asan/TestCases/Linux/uar_signals.cc
+++ b/test/asan/TestCases/Linux/uar_signals.cc
@@ -1,6 +1,6 @@
// This test checks that the implementation of use-after-return
// is async-signal-safe.
-// RUN: %clangxx_asan -O1 %s -o %t -lpthread && %run %t
+// RUN: %clangxx_asan -O1 %s -o %t -pthread && %run %t
#include <signal.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/test/asan/TestCases/Linux/unpoison_tls.cc b/test/asan/TestCases/Linux/unpoison_tls.cc
index 4c693b429..9c1d74b28 100644
--- a/test/asan/TestCases/Linux/unpoison_tls.cc
+++ b/test/asan/TestCases/Linux/unpoison_tls.cc
@@ -1,7 +1,7 @@
// Test that TLS is unpoisoned on thread death.
// REQUIRES: x86_64-supported-target,i386-supported-target
-// RUN: %clangxx_asan -O1 %s -lpthread -o %t && %run %t 2>&1
+// RUN: %clangxx_asan -O1 %s -pthread -o %t && %run %t 2>&1
#include <assert.h>
#include <pthread.h>
diff --git a/test/asan/TestCases/Posix/init-order-dlopen.cc b/test/asan/TestCases/Posix/init-order-dlopen.cc
index f7b0d6aca..2b86ace2c 100644
--- a/test/asan/TestCases/Posix/init-order-dlopen.cc
+++ b/test/asan/TestCases/Posix/init-order-dlopen.cc
@@ -10,8 +10,8 @@
// If the linker doesn't support --export-dynamic (which is ELF-specific),
// try to link without that option.
// FIXME: find a better solution.
-// RUN: %clangxx_asan -O0 %s -lpthread -ldl -o %t -Wl,--export-dynamic || \
-// RUN: %clangxx_asan -O0 %s -lpthread -ldl -o %t
+// RUN: %clangxx_asan -O0 %s -pthread -ldl -o %t -Wl,--export-dynamic || \
+// RUN: %clangxx_asan -O0 %s -pthread -ldl -o %t
// RUN: ASAN_OPTIONS=strict_init_order=true %run %t 2>&1 | FileCheck %s
#if !defined(SHARED_LIB)
#include <dlfcn.h>
diff --git a/test/asan/TestCases/current_allocated_bytes.cc b/test/asan/TestCases/current_allocated_bytes.cc
index a9cd15949..413d1a215 100644
--- a/test/asan/TestCases/current_allocated_bytes.cc
+++ b/test/asan/TestCases/current_allocated_bytes.cc
@@ -1,5 +1,5 @@
-// RUN: %clangxx_asan -O0 %s -lpthread -o %t && %run %t
-// RUN: %clangxx_asan -O2 %s -lpthread -o %t && %run %t
+// RUN: %clangxx_asan -O0 %s -pthread -o %t && %run %t
+// RUN: %clangxx_asan -O2 %s -pthread -o %t && %run %t
#include <assert.h>
#include <pthread.h>
diff --git a/test/asan/TestCases/deep_thread_stack.cc b/test/asan/TestCases/deep_thread_stack.cc
index 1e802b089..23c8bc88f 100644
--- a/test/asan/TestCases/deep_thread_stack.cc
+++ b/test/asan/TestCases/deep_thread_stack.cc
@@ -1,7 +1,7 @@
-// RUN: %clangxx_asan -O0 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O1 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O1 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O2 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
#include <pthread.h>
diff --git a/test/asan/TestCases/gc-test.cc b/test/asan/TestCases/gc-test.cc
index b15e66810..76113ec42 100644
--- a/test/asan/TestCases/gc-test.cc
+++ b/test/asan/TestCases/gc-test.cc
@@ -1,4 +1,4 @@
-// RUN: %clangxx_asan %s -lpthread -o %t
+// RUN: %clangxx_asan %s -pthread -o %t
// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK1
// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t 2>&1 | FileCheck %s --check-prefix=CHECK0
diff --git a/test/asan/TestCases/init-order-pthread-create.cc b/test/asan/TestCases/init-order-pthread-create.cc
index e3334364e..eeff308a4 100644
--- a/test/asan/TestCases/init-order-pthread-create.cc
+++ b/test/asan/TestCases/init-order-pthread-create.cc
@@ -1,7 +1,7 @@
// Check that init-order checking is properly disabled if pthread_create is
// called.
-// RUN: %clangxx_asan %s %p/Helpers/init-order-pthread-create-extra.cc -lpthread -o %t
+// RUN: %clangxx_asan %s %p/Helpers/init-order-pthread-create-extra.cc -pthread -o %t
// RUN: env ASAN_OPTIONS=strict_init_order=true %run %t
#include <stdio.h>
diff --git a/test/asan/TestCases/stack-overflow.cc b/test/asan/TestCases/stack-overflow.cc
index 4861fd211..4b9e75b98 100644
--- a/test/asan/TestCases/stack-overflow.cc
+++ b/test/asan/TestCases/stack-overflow.cc
@@ -1,18 +1,18 @@
// Test ASan detection of stack-overflow condition.
-// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O0 %s -DTHREAD -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -DTHREAD -lpthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DTHREAD -DSMALL_FRAME -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DTHREAD -DSAVE_ALL_THE_REGISTERS -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -DTHREAD -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -DTHREAD -pthread -o %t && env ASAN_OPTIONS=use_sigaltstack=1 not %run %t 2>&1 | FileCheck %s
// RUN: not %run %t 2>&1 | FileCheck %s
#include <assert.h>
diff --git a/test/asan/TestCases/stack-use-after-return.cc b/test/asan/TestCases/stack-use-after-return.cc
index e31a63cfe..437c45774 100644
--- a/test/asan/TestCases/stack-use-after-return.cc
+++ b/test/asan/TestCases/stack-use-after-return.cc
@@ -1,14 +1,14 @@
// RUN: export ASAN_OPTIONS=detect_stack_use_after_return=1
-// RUN: %clangxx_asan -O0 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O1 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O2 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
-// RUN: %clangxx_asan -O3 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O0 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O1 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O2 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
+// RUN: %clangxx_asan -O3 %s -pthread -o %t && not %run %t 2>&1 | FileCheck %s
// RUN: env ASAN_OPTIONS=detect_stack_use_after_return=0 %run %t
// Regression test for a CHECK failure with small stack size and large frame.
-// RUN: %clangxx_asan -O3 %s -lpthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
+// RUN: %clangxx_asan -O3 %s -pthread -o %t -DkSize=10000 -DUseThread -DkStackSize=65536 && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
//
// Test that we can find UAR in a thread other than main:
-// RUN: %clangxx_asan -DUseThread -O2 %s -lpthread -o %t && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
+// RUN: %clangxx_asan -DUseThread -O2 %s -pthread -o %t && not %run %t 2>&1 | FileCheck --check-prefix=THREAD %s
//
// Test the max_uar_stack_size_log/min_uar_stack_size_log flag.
//
diff --git a/test/asan/lit.cfg b/test/asan/lit.cfg
index ad9786f3e..ac88223b8 100644
--- a/test/asan/lit.cfg
+++ b/test/asan/lit.cfg
@@ -26,7 +26,7 @@ config.test_source_root = os.path.dirname(__file__)
# GCC-ASan doesn't link in all the necessary libraries automatically, so
# we have to do it ourselves.
if config.compiler_id == 'GNU':
- extra_linkflags = ["-lpthread", "-lstdc++", "-ldl"]
+ extra_linkflags = ["-pthread", "-lstdc++", "-ldl"]
else:
extra_linkflags = []
# Setup default compiler flags used with -fsanitize=address option.
diff --git a/test/tsan/lit.cfg b/test/tsan/lit.cfg
index ae2197135..7b7c2bb71 100644
--- a/test/tsan/lit.cfg
+++ b/test/tsan/lit.cfg
@@ -24,7 +24,7 @@ config.environment['TSAN_OPTIONS'] = tsan_options
# GCC driver doesn't add necessary compile/link flags with -fsanitize=thread.
if config.compiler_id == 'GNU':
- extra_cflags = ["-fPIE", "-lpthread", "-ldl", "-lstdc++", "-lrt", "-pie"]
+ extra_cflags = ["-fPIE", "-pthread", "-ldl", "-lstdc++", "-lrt", "-pie"]
else:
extra_cflags = []
diff --git a/test/tsan/test_output.sh b/test/tsan/test_output.sh
index 8a15a6738..c22258fa1 100755
--- a/test/tsan/test_output.sh
+++ b/test/tsan/test_output.sh
@@ -14,7 +14,7 @@ BLACKLIST=$HERE/Helpers/blacklist.txt
# TODO: add testing for all of -O0...-O3
CFLAGS="-fsanitize=thread -fsanitize-blacklist=$BLACKLIST -fPIE -O1 -g -Wall"
-LDFLAGS="-pie -lpthread -ldl -lrt -lm -Wl,--whole-archive $TSAN_DIR/rtl/libtsan.a -Wl,--no-whole-archive"
+LDFLAGS="-pie -pthread -ldl -lrt -lm -Wl,--whole-archive $TSAN_DIR/rtl/libtsan.a -Wl,--no-whole-archive"
test_file() {
SRC=$1