diff --git a/compiler-rt/test/lsan/CMakeLists.txt b/compiler-rt/test/lsan/CMakeLists.txt --- a/compiler-rt/test/lsan/CMakeLists.txt +++ b/compiler-rt/test/lsan/CMakeLists.txt @@ -1,7 +1,7 @@ set(LSAN_LIT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(LSAN_TESTSUITES) - + set(LSAN_TEST_ARCH ${LSAN_SUPPORTED_ARCH}) if(APPLE) darwin_filter_host_archs(LSAN_SUPPORTED_ARCH LSAN_TEST_ARCH) @@ -12,9 +12,9 @@ string(TOLOWER "-${arch}" LSAN_TEST_CONFIG_SUFFIX) get_test_cc_for_arch(${arch} LSAN_TEST_TARGET_CC LSAN_TEST_TARGET_CFLAGS) string(TOUPPER ${arch} ARCH_UPPER_CASE) + set(LSAN_LIT_TEST_MODE "Standalone") set(CONFIG_NAME ${ARCH_UPPER_CASE}LsanConfig) - configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) @@ -22,11 +22,19 @@ set(CONFIG_NAME ${ARCH_UPPER_CASE}AsanConfig) set(LSAN_LIT_TEST_MODE "AddressSanitizer") - configure_lit_site_cfg( ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) + + if (ARCH_UPPER_CASE STREQUAL "X86_64") + set(CONFIG_NAME ${ARCH_UPPER_CASE}HWAsanConfig) + set(LSAN_LIT_TEST_MODE "HWAddressSanitizer") + configure_lit_site_cfg( + ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in + ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}/lit.site.cfg.py) + list(APPEND LSAN_TESTSUITES ${CMAKE_CURRENT_BINARY_DIR}/${CONFIG_NAME}) + endif() endforeach() set(LSAN_TEST_DEPS ${SANITIZER_COMMON_LIT_TEST_DEPS}) diff --git a/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm b/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm --- a/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm +++ b/compiler-rt/test/lsan/TestCases/Darwin/dispatch.mm @@ -55,4 +55,4 @@ // CHECK: Test alloc: [[addr:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[addr]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c b/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c --- a/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c +++ b/compiler-rt/test/lsan/TestCases/Linux/cleanup_in_tsd_destructor.c @@ -8,7 +8,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=0" not %run %t 2>&1 | FileCheck %s // Investigate why it does not fail with use_stack=0 -// UNSUPPORTED: arm-linux || armhf-linux +// UNSUPPORTED: arm-linux || armhf-linux || hwasan #include #include diff --git a/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c b/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c --- a/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c +++ b/compiler-rt/test/lsan/TestCases/Linux/disabler_in_tsd_destructor.c @@ -1,6 +1,7 @@ // Regression test. Disabler should not depend on TSD validity. // RUN: %clang_lsan %s -o %t // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0:use_tls=1:use_ld_allocations=0" %run %t +// UNSUPPORTED: hwasan #include #include diff --git a/compiler-rt/test/lsan/TestCases/Linux/fork_threaded.cpp b/compiler-rt/test/lsan/TestCases/Linux/fork_threaded.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/fork_threaded.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/fork_threaded.cpp @@ -2,6 +2,7 @@ // exec(). In this test leak checking is initiated from a non-main thread. // RUN: %clangxx_lsan %s -o %t // RUN: %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include diff --git a/compiler-rt/test/lsan/TestCases/Linux/guard-page.c b/compiler-rt/test/lsan/TestCases/Linux/guard-page.c --- a/compiler-rt/test/lsan/TestCases/Linux/guard-page.c +++ b/compiler-rt/test/lsan/TestCases/Linux/guard-page.c @@ -2,7 +2,7 @@ // if swapcontext is used), LSan will not hit the guard page. // RUN: %clang_lsan %s -o %t && %run %t // Missing 'getcontext' and 'makecontext' on Android. -// UNSUPPORTED: android +// UNSUPPORTED: android || hwasan #include #include diff --git a/compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp b/compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/libdl_deadlock.cpp @@ -1,6 +1,7 @@ // Regression test for a deadlock in leak detection, // where lsan would call dl_iterate_phdr while holding the allocator lock. // RUN: %clangxx_lsan %s -o %t && %run %t +// UNSUPPORTED: hwasan #include #include diff --git a/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp b/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/log-path_test.cpp @@ -27,4 +27,4 @@ // CHECK-ERROR: LeakSanitizer: detected memory leaks // CHECK-ERROR: Direct leak of 1337 byte(s) in 1 object(s) allocated from -// CHECK-ERROR: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK-ERROR: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_dynamic.cpp @@ -50,7 +50,7 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: #else // BUILD_DSO // A loadable module with a large thread local section, which would require diff --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_dynamic.cpp @@ -5,7 +5,7 @@ // RUN: %env_lsan_opts="" %run %t 2>&1 // Investigate why it does not fail with use_tls=0 -// UNSUPPORTED: arm-linux || armhf-linux +// UNSUPPORTED: arm-linux || armhf-linux || hwasan #include #include @@ -37,4 +37,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_pthread_specific_static.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -31,4 +32,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp b/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp --- a/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp +++ b/compiler-rt/test/lsan/TestCases/Linux/use_tls_static.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_tls=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -18,4 +19,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/default_options.cpp b/compiler-rt/test/lsan/TestCases/default_options.cpp --- a/compiler-rt/test/lsan/TestCases/default_options.cpp +++ b/compiler-rt/test/lsan/TestCases/default_options.cpp @@ -1,8 +1,9 @@ // RUN: %clangxx_lsan -O2 %s -o %t && %run %t 2>&1 | FileCheck %s +// UNSUPPORTED: hwasan extern "C" const char *__lsan_default_options() { - // CHECK: Available flags for {{Leak|Address}}Sanitizer: + // CHECK: Available flags for {{.*}}Sanitizer: return "verbosity=1 help=1"; } diff --git a/compiler-rt/test/lsan/TestCases/disabler.c b/compiler-rt/test/lsan/TestCases/disabler.c --- a/compiler-rt/test/lsan/TestCases/disabler.c +++ b/compiler-rt/test/lsan/TestCases/disabler.c @@ -23,4 +23,4 @@ fprintf(stderr, "Test alloc: %p.\n", q); return 0; } -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp b/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp --- a/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp +++ b/compiler-rt/test/lsan/TestCases/do_leak_check_override.cpp @@ -34,5 +34,5 @@ return 0; } -// CHECK-strict: SUMMARY: {{(Leak|Address)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s) -// CHECK-normal: SUMMARY: {{(Leak|Address)}}Sanitizer: 666 byte(s) leaked in 1 allocation(s) +// CHECK-strict: SUMMARY: {{(.*)}}Sanitizer: 2003 byte(s) leaked in 2 allocation(s) +// CHECK-normal: SUMMARY: {{(.*)}}Sanitizer: 666 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp b/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp --- a/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp +++ b/compiler-rt/test/lsan/TestCases/high_allocator_contention.cpp @@ -2,6 +2,8 @@ // Usage: ./a.out number_of_threads total_number_of_allocations // RUN: %clangxx_lsan %s -o %t // RUN: %env_lsan_opts=use_ld_allocations=0 %run %t 5 1000000 2>&1 +// UNSUPPORTED: hwasan + #include #include #include diff --git a/compiler-rt/test/lsan/TestCases/ignore_object.c b/compiler-rt/test/lsan/TestCases/ignore_object.c --- a/compiler-rt/test/lsan/TestCases/ignore_object.c +++ b/compiler-rt/test/lsan/TestCases/ignore_object.c @@ -22,4 +22,4 @@ return 0; } // CHECK: Test alloc: [[ADDR:.*]]. -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp b/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp --- a/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp +++ b/compiler-rt/test/lsan/TestCases/large_allocation_leak.cpp @@ -19,4 +19,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (33554432 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp b/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp --- a/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp +++ b/compiler-rt/test/lsan/TestCases/leak_check_at_exit.cpp @@ -16,5 +16,5 @@ return 0; } -// CHECK-do: SUMMARY: {{(Leak|Address)}}Sanitizer: -// CHECK-dont-NOT: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK-do: SUMMARY: {{(.*)}}Sanitizer: +// CHECK-dont-NOT: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/link_turned_off.cpp b/compiler-rt/test/lsan/TestCases/link_turned_off.cpp --- a/compiler-rt/test/lsan/TestCases/link_turned_off.cpp +++ b/compiler-rt/test/lsan/TestCases/link_turned_off.cpp @@ -22,4 +22,4 @@ return 0; } -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 4 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/malloc_zero.c b/compiler-rt/test/lsan/TestCases/malloc_zero.c --- a/compiler-rt/test/lsan/TestCases/malloc_zero.c +++ b/compiler-rt/test/lsan/TestCases/malloc_zero.c @@ -2,13 +2,13 @@ // RUN: %env_lsan_opts=use_stacks=0 not %run %t 2>&1 | FileCheck %s /// Fails when only leak sanitizer is enabled -// UNSUPPORTED: arm-linux, armhf-linux +// UNSUPPORTED: arm-linux, armhf-linux, hwasan #include #include -// CHECK: {{Leak|Address}}Sanitizer: detected memory leaks -// CHECK: {{Leak|Address}}Sanitizer: 1 byte(s) leaked in 1 allocation(s). +// CHECK: {{.*}}Sanitizer: detected memory leaks +// CHECK: {{.*}}Sanitizer: 1 byte(s) leaked in 1 allocation(s). int main() { // The behavior of malloc(0) is implementation-defined. diff --git a/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp b/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp --- a/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp +++ b/compiler-rt/test/lsan/TestCases/many_tls_keys_pthread.cpp @@ -9,7 +9,7 @@ // UNSUPPORTED: arm-linux, armhf-linux // TSD on NetBSD does not use TLS -// UNSUPPORTED: target={{.*netbsd.*}} +// UNSUPPORTED: target={{.*netbsd.*}}, hwasan #include #include @@ -74,4 +74,4 @@ } // CHECK: LeakSanitizer: detected memory leaks -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp b/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp --- a/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp +++ b/compiler-rt/test/lsan/TestCases/many_tls_keys_thread.cpp @@ -5,7 +5,7 @@ // RUN: %env_lsan_opts="" %run %t 2>&1 // Patch r303906 did not fix all the problems. -// UNSUPPORTED: arm-linux,armhf-linux +// UNSUPPORTED: arm-linux,armhf-linux,hwasan #include #include @@ -57,4 +57,4 @@ } // CHECK: LeakSanitizer: detected memory leaks -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp b/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp --- a/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp +++ b/compiler-rt/test/lsan/TestCases/pointer_to_self.cpp @@ -2,6 +2,7 @@ // object is indirectly leaked. Only external pointers count. // RUN: %clangxx_lsan %s -o %t // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s +// UNSUPPORTED: hwasan #include #include @@ -15,4 +16,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/realloc_too_big.c b/compiler-rt/test/lsan/TestCases/realloc_too_big.c --- a/compiler-rt/test/lsan/TestCases/realloc_too_big.c +++ b/compiler-rt/test/lsan/TestCases/realloc_too_big.c @@ -3,15 +3,16 @@ /// Fails when only leak sanitizer is enabled // UNSUPPORTED: arm-linux, armhf-linux +// UNSUPPORTED: hwasan #include #include #include -// CHECK: {{Leak|Address}}Sanitizer failed to allocate 0x100001 bytes +// CHECK: {{.*}}Sanitizer failed to allocate 0x100001 bytes -// CHECK: {{Leak|Address}}Sanitizer: detected memory leaks -// CHECK: {{Leak|Address}}Sanitizer: 9 byte(s) leaked in 1 allocation(s). +// CHECK: {{.*}}Sanitizer: detected memory leaks +// CHECK: {{.*}}Sanitizer: 9 byte(s) leaked in 1 allocation(s). int main() { char *p = malloc(9); diff --git a/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp b/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp --- a/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp +++ b/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cpp @@ -22,12 +22,12 @@ // CHECK: Test alloc: assert(__lsan_do_recoverable_leak_check() == 1); -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1337 byte // Test that we correctly reset chunk tags. p = 0; assert(__lsan_do_recoverable_leak_check() == 1); -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1360 byte +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1360 byte _exit(0); } diff --git a/compiler-rt/test/lsan/TestCases/register_root_region.cpp b/compiler-rt/test/lsan/TestCases/register_root_region.cpp --- a/compiler-rt/test/lsan/TestCases/register_root_region.cpp +++ b/compiler-rt/test/lsan/TestCases/register_root_region.cpp @@ -28,4 +28,4 @@ return 0; } // CHECK: Test alloc: [[ADDR:.*]]. -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp b/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp --- a/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp +++ b/compiler-rt/test/lsan/TestCases/stale_stack_leak.cpp @@ -52,5 +52,5 @@ // CHECK-sanity: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: // CHECK-sanity: Value after LSan: [[ADDR]] diff --git a/compiler-rt/test/lsan/TestCases/suppressions_default.cpp b/compiler-rt/test/lsan/TestCases/suppressions_default.cpp --- a/compiler-rt/test/lsan/TestCases/suppressions_default.cpp +++ b/compiler-rt/test/lsan/TestCases/suppressions_default.cpp @@ -24,4 +24,4 @@ } // CHECK: Suppressions used: // CHECK: 1 666 *LSanTestLeakingFunc* -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/suppressions_file.cpp b/compiler-rt/test/lsan/TestCases/suppressions_file.cpp --- a/compiler-rt/test/lsan/TestCases/suppressions_file.cpp +++ b/compiler-rt/test/lsan/TestCases/suppressions_file.cpp @@ -36,6 +36,6 @@ } // CHECK: Suppressions used: // CHECK: 1 666 *LSanTestLeakingFunc* -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 1337 byte(s) leaked in 1 allocation(s) -// NOSUPP: SUMMARY: {{(Leak|Address)}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s). +// NOSUPP: SUMMARY: {{(.*)}}Sanitizer: 2780 byte(s) leaked in 3 allocation(s). diff --git a/compiler-rt/test/lsan/TestCases/swapcontext.cpp b/compiler-rt/test/lsan/TestCases/swapcontext.cpp --- a/compiler-rt/test/lsan/TestCases/swapcontext.cpp +++ b/compiler-rt/test/lsan/TestCases/swapcontext.cpp @@ -41,4 +41,4 @@ return 0; } -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s) +// CHECK: SUMMARY: {{(.*)}}Sanitizer: 2664 byte(s) leaked in 1 allocation(s) diff --git a/compiler-rt/test/lsan/TestCases/use_after_return.cpp b/compiler-rt/test/lsan/TestCases/use_after_return.cpp --- a/compiler-rt/test/lsan/TestCases/use_after_return.cpp +++ b/compiler-rt/test/lsan/TestCases/use_after_return.cpp @@ -6,7 +6,7 @@ // RUN: env ASAN_OPTIONS=detect_stack_use_after_return=1 %env_lsan_opts="" %run %t 2>&1 // Investigate why it does not fail with use_stack=0 -// UNSUPPORTED: arm-linux || armhf-linux +// UNSUPPORTED: arm-linux || armhf-linux || hwasan #include #include @@ -23,4 +23,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp b/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp --- a/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp +++ b/compiler-rt/test/lsan/TestCases/use_globals_initialized.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -18,4 +19,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp b/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp --- a/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp +++ b/compiler-rt/test/lsan/TestCases/use_globals_uninitialized.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_globals=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -18,4 +19,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_registers.cpp b/compiler-rt/test/lsan/TestCases/use_registers.cpp --- a/compiler-rt/test/lsan/TestCases/use_registers.cpp +++ b/compiler-rt/test/lsan/TestCases/use_registers.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include "sanitizer_common/print_address.h" #include @@ -77,4 +78,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp b/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp --- a/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp +++ b/compiler-rt/test/lsan/TestCases/use_registers_extra.cpp @@ -6,6 +6,7 @@ // FIXME: Support more platforms. // REQUIRES: x86-target-arch && linux +// UNSUPPORTED: hwasan #include "sanitizer_common/print_address.h" #include @@ -57,4 +58,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_stacks.cpp b/compiler-rt/test/lsan/TestCases/use_stacks.cpp --- a/compiler-rt/test/lsan/TestCases/use_stacks.cpp +++ b/compiler-rt/test/lsan/TestCases/use_stacks.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -17,4 +18,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp b/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp --- a/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp +++ b/compiler-rt/test/lsan/TestCases/use_stacks_threaded.cpp @@ -3,6 +3,7 @@ // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_registers=0:use_stacks=1" %run %t 2>&1 // RUN: %env_lsan_opts="" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -34,4 +35,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/TestCases/use_unaligned.cpp b/compiler-rt/test/lsan/TestCases/use_unaligned.cpp --- a/compiler-rt/test/lsan/TestCases/use_unaligned.cpp +++ b/compiler-rt/test/lsan/TestCases/use_unaligned.cpp @@ -2,6 +2,7 @@ // RUN: %clangxx_lsan %s -o %t // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_unaligned=0" not %run %t 2>&1 | FileCheck %s // RUN: %env_lsan_opts="report_objects=1:use_stacks=0:use_registers=0:use_unaligned=1" %run %t 2>&1 +// UNSUPPORTED: hwasan #include #include @@ -20,4 +21,4 @@ // CHECK: Test alloc: [[ADDR:0x[0-9,a-f]+]] // CHECK: LeakSanitizer: detected memory leaks // CHECK: [[ADDR]] (1337 bytes) -// CHECK: SUMMARY: {{(Leak|Address)}}Sanitizer: +// CHECK: SUMMARY: {{(.*)}}Sanitizer: diff --git a/compiler-rt/test/lsan/lit.common.cfg.py b/compiler-rt/test/lsan/lit.common.cfg.py --- a/compiler-rt/test/lsan/lit.common.cfg.py +++ b/compiler-rt/test/lsan/lit.common.cfg.py @@ -31,6 +31,13 @@ config.available_features.add('asan') if config.host_os == 'NetBSD': config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix)) +elif lsan_lit_test_mode == "HWAddressSanitizer": + config.name = "LeakSanitizer-HWAddressSanitizer" + lsan_cflags = ["-fsanitize=hwaddress", "-fuse-ld=lld", + "-fsanitize-hwaddress-experimental-aliasing"] + config.available_features.add('hwasan') + if config.host_os == 'NetBSD': + config.substitutions.insert(0, ('%run', config.netbsd_noaslr_prefix)) else: lit_config.fatal("Unknown LSan test mode: %r" % lsan_lit_test_mode) config.name += config.name_suffix @@ -72,6 +79,9 @@ config.substitutions.append( ("%clangxx ", build_invocation(clang_cxxflags)) ) config.substitutions.append( ("%clang_lsan ", build_invocation(clang_lsan_cflags)) ) config.substitutions.append( ("%clangxx_lsan ", build_invocation(clang_lsan_cxxflags)) ) +config.substitutions.append( ("%clang_hwasan ", build_invocation(clang_lsan_cflags)) ) +config.substitutions.append( ("%clangxx_hwasan ", build_invocation(clang_lsan_cxxflags)) ) + # LeakSanitizer tests are currently supported on # Android{aarch64, x86, x86_64}, x86-64 Linux, PowerPC64 Linux, arm Linux, mips64 Linux, s390x Linux, loongarch64 Linux and x86_64 Darwin.