diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2017-12-23 00:30:51 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2017-12-23 00:30:51 +0000 |
commit | d86233428832a65ba5b19ff8621eb703c37397b5 (patch) | |
tree | c6d377412a35ec98c583e9dee4fac1019bb2d66c /test/asan/TestCases/Linux/aligned_delete_test.cc | |
parent | 4d53d6d104c990fb5c2626ddab37a693b6d4f749 (diff) |
[Sanitizers] Export aligned new/delete from runtimes.
Summary:
Export aligned new/delete to make dynamic runtimes work again.
Remove all valid new/delete cases from ASan test, there's a test in
common for that.
Reviewers: eugenis
Subscribers: srhines, kubamracek, #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D41548
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@321394 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/asan/TestCases/Linux/aligned_delete_test.cc')
-rw-r--r-- | test/asan/TestCases/Linux/aligned_delete_test.cc | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/test/asan/TestCases/Linux/aligned_delete_test.cc b/test/asan/TestCases/Linux/aligned_delete_test.cc index 5b9455e56..9117198f9 100644 --- a/test/asan/TestCases/Linux/aligned_delete_test.cc +++ b/test/asan/TestCases/Linux/aligned_delete_test.cc @@ -6,12 +6,10 @@ // 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 -// REQUIRES: asan-static-runtime - #include <stdio.h> // Define all new/delete to do not depend on the version provided by the -// plaform. The implementation is provided by ASan anyway. +// platform. The implementation is provided by ASan anyway. namespace std { struct nothrow_t {}; @@ -57,34 +55,8 @@ struct alignas(1024) S1024_1024 { char a[1024]; }; int main(int argc, char **argv) { - fprintf(stderr, "Testing valid cases\n"); - - delete break_optimization(new S12); - operator delete(break_optimization(new S12), std::nothrow); - delete [] break_optimization(new S12[100]); - operator delete[](break_optimization(new S12[100]), std::nothrow); - - delete break_optimization(new S12_128); - operator delete(break_optimization(new S12_128), - std::align_val_t(alignof(S12_128))); - operator delete(break_optimization(new S12_128), - std::align_val_t(alignof(S12_128)), std::nothrow); - operator delete(break_optimization(new S12_128), sizeof(S12_128), - std::align_val_t(alignof(S12_128))); - - delete [] break_optimization(new S12_128[100]); - operator delete[](break_optimization(new S12_128[100]), - std::align_val_t(alignof(S12_128))); - operator delete[](break_optimization(new S12_128[100]), - std::align_val_t(alignof(S12_128)), std::nothrow); - operator delete[](break_optimization(new S12_128[100]), sizeof(S12_128[100]), - std::align_val_t(alignof(S12_128))); - - fprintf(stderr, "Done\n"); - // CHECK: Testing valid cases - // CHECK-NEXT: Done - - // Explicit mismatched calls. + // Check the mismatched calls only, all the valid cases are verified in + // test/sanitizer_common/TestCases/Linux/new_delete_test.cc. operator delete(break_optimization(new S12_128), std::nothrow); // CHECK: AddressSanitizer: new-delete-type-mismatch |