Skip to content

Commit

Permalink
[sanitizer,test] Restore -fno-sized-deallocation coverage
Browse files Browse the repository at this point in the history
-fsized-deallocation was recently made the default for C++17 onwards
(llvm#90373). While here, remove unneeded -faligned-allocation.
  • Loading branch information
MaskRay authored and bwendling committed Aug 15, 2024
1 parent 85be25f commit 9b6ce58
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions compiler-rt/test/asan/TestCases/Linux/aligned_delete_test.cpp
Original file line number Diff line number Diff line change
@@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/hwasan/TestCases/new-test.cpp
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/test/scudo/aligned-new.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 9b6ce58

Please sign in to comment.