diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-27 20:40:24 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2015-08-27 20:40:24 +0000 |
commit | d5cf8871a5c7a97d4142e710951aa6da86fcdbf3 (patch) | |
tree | 0c88d6bcd1915e9cdb321ad57d17821d6566e16f /test/sanitizer_common/TestCases/Linux/abort_on_error.cc | |
parent | 0d4ac1534aa164773dc4dd5cf42e6e35c387a039 (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.cc | 20 |
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; +} |