summaryrefslogtreecommitdiffstats
path: root/compiler-rt
diff options
context:
space:
mode:
authorYury Gribov <y.gribov@samsung.com>2015-11-11 15:42:26 +0000
committerYury Gribov <y.gribov@samsung.com>2015-11-11 15:42:26 +0000
commit8fbd938641ba9e8add04ac269587992827009c3f (patch)
treeaab07a67f5af513f35ac63e878dc1e195af95eca /compiler-rt
parentfcbb0ec06e3f8aa2f65a485fc7bde3c64d67017e (diff)
downloadbcm5719-llvm-8fbd938641ba9e8add04ac269587992827009c3f.tar.gz
bcm5719-llvm-8fbd938641ba9e8add04ac269587992827009c3f.zip
[ASan] Improve portability of new tests.
llvm-svn: 252742
Diffstat (limited to 'compiler-rt')
-rw-r--r--compiler-rt/test/asan/TestCases/Linux/halt_on_error-signals.c5
-rw-r--r--compiler-rt/test/asan/TestCases/Linux/halt_on_error-torture.cc4
2 files changed, 7 insertions, 2 deletions
diff --git a/compiler-rt/test/asan/TestCases/Linux/halt_on_error-signals.c b/compiler-rt/test/asan/TestCases/Linux/halt_on_error-signals.c
index 93d5f4b2670..a1ea8c8985d 100644
--- a/compiler-rt/test/asan/TestCases/Linux/halt_on_error-signals.c
+++ b/compiler-rt/test/asan/TestCases/Linux/halt_on_error-signals.c
@@ -1,6 +1,6 @@
// Test interaction of Asan recovery mode with asynch signals.
//
-// RUN: %clang_asan -fsanitize-recover=address %s -o %t
+// RUN: %clang_asan -fsanitize-recover=address -pthread %s -o %t
//
// RUN: rm -f %t.log
// RUN: env ASAN_OPTIONS=halt_on_error=false %run %t 1000 >%t.log 2>&1 || true
@@ -10,6 +10,9 @@
//
// REQUIRES: stable-runtime
+#define _POSIX_C_SOURCE 200112 // rand_r
+#define _SVID_SOURCE 1 // SA_NODEFER
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/compiler-rt/test/asan/TestCases/Linux/halt_on_error-torture.cc b/compiler-rt/test/asan/TestCases/Linux/halt_on_error-torture.cc
index 6b100d7a060..443c18ef19b 100644
--- a/compiler-rt/test/asan/TestCases/Linux/halt_on_error-torture.cc
+++ b/compiler-rt/test/asan/TestCases/Linux/halt_on_error-torture.cc
@@ -1,6 +1,6 @@
// Stress test recovery mode with many threads.
//
-// RUN: %clangxx_asan -fsanitize-recover=address %s -o %t
+// RUN: %clangxx_asan -fsanitize-recover=address -pthread %s -o %t
//
// RUN: env ASAN_OPTIONS=halt_on_error=false:max_errors=1000 %run %t 1 10 >1.txt 2>&1
// RUN: FileCheck %s < 1.txt
@@ -15,6 +15,8 @@
//
// REQUIRES: stable-runtime
+#define _POSIX_C_SOURCE 200112 // rand_r
+
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
OpenPOWER on IntegriCloud