From d5cf8871a5c7a97d4142e710951aa6da86fcdbf3 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Thu, 27 Aug 2015 20:40:24 +0000 Subject: [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 --- .../TestCases/Linux/abort_on_error.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/sanitizer_common/TestCases/Linux/abort_on_error.cc (limited to 'test/sanitizer_common/TestCases/Linux/abort_on_error.cc') 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; +} -- cgit v1.2.3