diff options
author | Alexey Samsonov <vonosmas@gmail.com> | 2014-09-19 18:33:45 +0000 |
---|---|---|
committer | Alexey Samsonov <vonosmas@gmail.com> | 2014-09-19 18:33:45 +0000 |
commit | a82d43abfe5ac2c3067bbd71a17bb94cd5d4ba1f (patch) | |
tree | e98c5bf0b48130caef75e09a8f8b2c72aefe235b /test/ubsan | |
parent | 2bc599a96d1e7cb308b470fa18f6df45e7561a50 (diff) | |
download | compiler-rt-a82d43abfe5ac2c3067bbd71a17bb94cd5d4ba1f.tar.gz |
[UBSan] Optionally report summary in UBSan error reports.
By default summary is not printed if UBSan is run in a standalone mode,
but is printed if it's combined with another sanitizer (like ASan).
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@218135 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/ubsan')
-rw-r--r-- | test/ubsan/TestCases/Integer/summary.cpp | 10 | ||||
-rw-r--r-- | test/ubsan/lit.common.cfg | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/ubsan/TestCases/Integer/summary.cpp b/test/ubsan/TestCases/Integer/summary.cpp new file mode 100644 index 000000000..d6fecd2ab --- /dev/null +++ b/test/ubsan/TestCases/Integer/summary.cpp @@ -0,0 +1,10 @@ +// RUN: %clangxx -fsanitize=integer %s -o %t && %t 2>&1 | FileCheck %s +// REQUIRES: ubsan-asan + +#include <stdint.h> + +int main() { + (void)(uint64_t(10000000000000000000ull) + uint64_t(9000000000000000000ull)); + // CHECK: SUMMARY: AddressSanitizer: runtime-error {{.*}}summary.cpp:[[@LINE-1]] + return 0; +} diff --git a/test/ubsan/lit.common.cfg b/test/ubsan/lit.common.cfg index 4e3e377f0..b91b4bf5a 100644 --- a/test/ubsan/lit.common.cfg +++ b/test/ubsan/lit.common.cfg @@ -18,9 +18,11 @@ config.test_source_root = os.path.dirname(__file__) ubsan_lit_test_mode = get_required_attr(config, 'ubsan_lit_test_mode') if ubsan_lit_test_mode == "Standalone": config.name = 'UndefinedBehaviorSanitizer-Standalone' + config.available_features.add("ubsan-standalone") clang_ubsan_cflags = [] elif ubsan_lit_test_mode == "AddressSanitizer": config.name = 'UndefinedBehaviorSanitizer-AddressSanitizer' + config.available_features.add("ubsan-asan") clang_ubsan_cflags = ["-fsanitize=address"] config.environment['ASAN_OPTIONS'] = 'detect_leaks=0' else: |