From c27415ff86a617bdaaf310f6888f084bdf0705ea Mon Sep 17 00:00:00 2001 From: Fangrui Song Date: Sat, 10 Aug 2024 11:02:07 -0700 Subject: [PATCH] [sanitizer,test] Restore -fno-sized-deallocation coverage -fsized-deallocation was recently made the default for C++17 onwards (#90373). While here, remove unneeded -faligned-allocation. --- compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp | 4 ++-- compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cpp | 2 +- compiler-rt/test/hwasan/TestCases/new-test.cpp | 2 +- .../test/sanitizer_common/TestCases/Linux/new_delete_test.cpp | 4 ++-- compiler-rt/test/scudo/aligned-new.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp b/compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp index 2325242e05a6..2a689e969b31 100644 --- a/compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp +++ b/compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp @@ -1,8 +1,8 @@ -// RUN: %clangxx_asan -std=c++1z -faligned-allocation -fsanitize-recover=address -O0 %s -o %t +// RUN: %clangxx_asan -fno-sized-deallocation -fsanitize-recover=address -O0 %s -o %t // RUN: %env_asan_opts=new_delete_type_mismatch=1:halt_on_error=false:detect_leaks=false %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=new_delete_type_mismatch=0 %run %t -// RUN: %clangxx_asan -std=c++1z -faligned-allocation -fsized-deallocation -fsanitize-recover=address -O0 %s -o %t +// RUN: %clangxx_asan -fsized-deallocation -fsanitize-recover=address -O0 %s -o %t // RUN: %env_asan_opts=new_delete_type_mismatch=1:halt_on_error=false:detect_leaks=false %run %t 2>&1 | FileCheck %s // RUN: %env_asan_opts=new_delete_type_mismatch=0 %run %t diff --git a/compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cpp b/compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cpp index 05f74bda7549..037c8b323d79 100644 --- a/compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cpp +++ b/compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cpp @@ -1,7 +1,7 @@ // Check that we report new[] vs delete as alloc-dealloc-mismatch and not as // new-delete-type-mismatch when -fsized-deallocation is enabled. -// RUN: %clangxx_asan -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s +// RUN: %clangxx_asan -fno-sized-deallocation -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s // RUN: %clangxx_asan -fsized-deallocation -g %s -o %t && %env_asan_opts=alloc_dealloc_mismatch=1 not %run %t 2>&1 | FileCheck %s #include diff --git a/compiler-rt/test/hwasan/TestCases/new-test.cpp b/compiler-rt/test/hwasan/TestCases/new-test.cpp index 5e22412aa050..f530d9c4fa0b 100644 --- a/compiler-rt/test/hwasan/TestCases/new-test.cpp +++ b/compiler-rt/test/hwasan/TestCases/new-test.cpp @@ -1,5 +1,5 @@ // Test basic new functionality. -// RUN: %clangxx_hwasan -std=c++17 %s -o %t -fsized-deallocation +// RUN: %clangxx_hwasan -std=c++17 %s -o %t // RUN: %run %t #include diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/new_delete_test.cpp b/compiler-rt/test/sanitizer_common/TestCases/Linux/new_delete_test.cpp index ab6950f29663..caaf8cbfa4bd 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/new_delete_test.cpp +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/new_delete_test.cpp @@ -1,5 +1,5 @@ -// RUN: %clangxx -std=c++1z -faligned-allocation -O0 %s -o %t && %run %t -// RUN: %clangxx -std=c++1z -faligned-allocation -fsized-deallocation -O0 %s -o %t && %run %t +// RUN: %clangxx -fno-sized-deallocation -O0 %s -o %t && %run %t +// RUN: %clangxx -fsized-deallocation -O0 %s -o %t && %run %t // ubsan does not intercept new/delete. // UNSUPPORTED: ubsan diff --git a/compiler-rt/test/scudo/aligned-new.cpp b/compiler-rt/test/scudo/aligned-new.cpp index 771dd3b82897..3c28d4abea12 100644 --- a/compiler-rt/test/scudo/aligned-new.cpp +++ b/compiler-rt/test/scudo/aligned-new.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx_scudo -std=c++1z -faligned-allocation %s -o %t +// RUN: %clangxx_scudo %s -o %t // RUN: %run %t valid 2>&1 // RUN: %env_scudo_opts=allocator_may_return_null=1 %run %t invalid 2>&1 // RUN: %env_scudo_opts=allocator_may_return_null=0 not %run %t invalid 2>&1 | FileCheck %s