[compiler-rt] c27415f - [sanitizer,test] Restore -fno-sized-deallocation coverage

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 10 11:02:12 PDT 2024


Author: Fangrui Song
Date: 2024-08-10T11:02:07-07:00
New Revision: c27415ff86a617bdaaf310f6888f084bdf0705ea

URL: https://github.com/llvm/llvm-project/commit/c27415ff86a617bdaaf310f6888f084bdf0705ea
DIFF: https://github.com/llvm/llvm-project/commit/c27415ff86a617bdaaf310f6888f084bdf0705ea.diff

LOG: [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.

Added: 
    

Modified: 
    compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp
    compiler-rt/test/asan/TestCases/Linux/new_delete_mismatch.cpp
    compiler-rt/test/hwasan/TestCases/new-test.cpp
    compiler-rt/test/sanitizer_common/TestCases/Linux/new_delete_test.cpp
    compiler-rt/test/scudo/aligned-new.cpp

Removed: 
    


################################################################################
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 2325242e05a639..2a689e969b3133 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 05f74bda7549ec..037c8b323d799c 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 <stdlib.h>

diff  --git a/compiler-rt/test/hwasan/TestCases/new-test.cpp b/compiler-rt/test/hwasan/TestCases/new-test.cpp
index 5e22412aa05078..f530d9c4fa0bf3 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 <cassert>

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 ab6950f296631b..caaf8cbfa4bd21 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 771dd3b8289711..3c28d4abea125c 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


        


More information about the llvm-commits mailing list