summaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2019-01-16 23:37:31 +0000
committerDan Liew <dan@su-root.co.uk>2019-01-16 23:37:31 +0000
commit719e1b507775d4efd12561a013d61951175c6929 (patch)
tree8b3b775b3293004b8c55687d04141c01d9249050 /test/sanitizer_common/TestCases
parent34b376a895c400afdd206f9cbe785e8e4dc0e16c (diff)
downloadcompiler-rt-719e1b507775d4efd12561a013d61951175c6929.tar.gz
Fix sanitizer tool list used to generate sanitizer_common tests to be up-to-date.
Summary: This replaces the sanitizer tool list (used for generating sanitizer_common configurations) with a tool list derived from existing build system information. Previously sanitizer_common had its own list of supported sanitizer tools. This was bad because it was out of sync with the rest of the build system. Notably it meant that the sanitizer_common runtime was only being tested on Darwin the ASan dylib and not the other sanitizer dylibs that are built for Darwin (LSan, TSan, and UBSan). Unfortunately enabling the tests against other sanitizer dylibs has lead to some test failures on Darwin. For now they've been marked as XFAIL until the failures can investigated properly. For Windows and Android we use the old sanitizer tool list to try avoid bot breakages. rdar://problem/47143078 Reviewers: kubamracek, george.karpenkov, yln, samsonov, vitalybuka, krytarowski Subscribers: srhines, mgorny, fedor.sergeev, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55740 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@351398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common/TestCases')
-rw-r--r--test/sanitizer_common/TestCases/Darwin/abort_on_error.cc12
-rw-r--r--test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc3
-rw-r--r--test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc3
-rw-r--r--test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc2
-rw-r--r--test/sanitizer_common/TestCases/symbolize_stack.cc3
5 files changed, 21 insertions, 2 deletions
diff --git a/test/sanitizer_common/TestCases/Darwin/abort_on_error.cc b/test/sanitizer_common/TestCases/Darwin/abort_on_error.cc
index e73f669d8..e25a676df 100644
--- a/test/sanitizer_common/TestCases/Darwin/abort_on_error.cc
+++ b/test/sanitizer_common/TestCases/Darwin/abort_on_error.cc
@@ -1,7 +1,7 @@
// Check that sanitizers on OS X crash the process by default (i.e.
// abort_on_error=1). See also Linux/abort_on_error.cc.
-// RUN: %clangxx %s -o %t
+// RUN: %clangxx -DUSING_%tool_name %s -o %t
// Intentionally don't inherit the default options.
// RUN: env %tool_options='' not --crash %run %t 2>&1
@@ -9,11 +9,19 @@
// When we use lit's default options, we shouldn't crash.
// RUN: not %run %t 2>&1
+// Leak detection isn't treated as an error so `abort_on_error=1` doesn't work.
+// UNSUPPORTED: lsan
+
int global;
int main() {
+#if defined(USING_ubsan)
+ int value = 5;
+ int computation = value / 0; // Division by zero.
+#else
volatile int *a = new int[100];
delete[] a;
- global = a[0]; // use-after-free: triggers ASan report.
+ global = a[0]; // use-after-free: triggers ASan/TSan report.
+#endif
return 0;
}
diff --git a/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc b/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
index 715282fd7..82fc8a845 100644
--- a/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
+++ b/test/sanitizer_common/TestCases/Darwin/print-stack-trace.cc
@@ -1,6 +1,9 @@
// RUN: %clangxx -O0 %s -o %t && %env_tool_opts=stack_trace_format=DEFAULT %run %t 2>&1 | FileCheck %s
// RUN: %env_tool_opts=stack_trace_format='"frame:%n lineno:%l"' %run %t 2>&1 | FileCheck %s --check-prefix=CUSTOM
+// FIXME(dliew): Make this test work with other sanitizers
+// XFAIL: darwin && (lsan || tsan || ubsan)
+
#include <sanitizer/common_interface_defs.h>
static inline void FooBarBaz() {
diff --git a/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc b/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
index 94c50be16..2a3ad6bee 100644
--- a/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
+++ b/test/sanitizer_common/TestCases/Posix/dedup_token_length_test.cc
@@ -10,6 +10,9 @@
// XFAIL: netbsd && !asan
+// FIXME(dliew): Make this test work with other sanitizers
+// XFAIL: darwin && (lsan || tsan || ubsan)
+
volatile int *null = 0;
namespace Xyz {
diff --git a/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc b/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
index 54272b017..ee8f82265 100644
--- a/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
+++ b/test/sanitizer_common/TestCases/Posix/sanitizer_set_death_callback_test.cc
@@ -3,6 +3,8 @@
// REQUIRES: stable-runtime
// XFAIL: ubsan
+// FIXME(dliew): Make this test work on Darwin with LSan
+// XFAIL: darwin && lsan
#include <sanitizer/common_interface_defs.h>
#include <stdio.h>
diff --git a/test/sanitizer_common/TestCases/symbolize_stack.cc b/test/sanitizer_common/TestCases/symbolize_stack.cc
index e50cdb063..0a2786931 100644
--- a/test/sanitizer_common/TestCases/symbolize_stack.cc
+++ b/test/sanitizer_common/TestCases/symbolize_stack.cc
@@ -2,6 +2,9 @@
// Test that symbolizer does not crash on frame with large function name.
+// FIXME(dliew): Make this test work with the other sanitizers.
+// XFAIL: darwin && (lsan || tsan || ubsan)
+
#include <sanitizer/common_interface_defs.h>
#include <vector>