summaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/Linux/abort_on_error.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <vonosmas@gmail.com>2015-08-27 20:40:24 +0000
committerAlexey Samsonov <vonosmas@gmail.com>2015-08-27 20:40:24 +0000
commitd5cf8871a5c7a97d4142e710951aa6da86fcdbf3 (patch)
tree0c88d6bcd1915e9cdb321ad57d17821d6566e16f /test/sanitizer_common/TestCases/Linux/abort_on_error.cc
parent0d4ac1534aa164773dc4dd5cf42e6e35c387a039 (diff)
[Sanitizers] Make abort_on_error common flag.
Summary: Teach all sanitizers to call abort() instead of _exit() after printing an error report, if requested. This behavior is the default on Mac OS. Reviewers: kcc, kubabrecka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12332 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@246205 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common/TestCases/Linux/abort_on_error.cc')
-rw-r--r--test/sanitizer_common/TestCases/Linux/abort_on_error.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/Linux/abort_on_error.cc b/test/sanitizer_common/TestCases/Linux/abort_on_error.cc
new file mode 100644
index 000000000..7e444c210
--- /dev/null
+++ b/test/sanitizer_common/TestCases/Linux/abort_on_error.cc
@@ -0,0 +1,20 @@
+// Check that sanitizers call _exit() on Linux by default (i.e.
+// abort_on_error=0). See also Darwin/abort_on_error.cc.
+
+// RUN: %clangxx %s -o %t
+
+// Intentionally don't inherit the default options.
+// RUN: %tool_options='' not %run %t 2>&1
+
+// When we use lit's default options, we shouldn't crash either. On Linux
+// lit doesn't set options anyway.
+// RUN: not %run %t 2>&1
+
+namespace __sanitizer {
+void Die();
+}
+
+int main() {
+ __sanitizer::Die();
+ return 0;
+}