1// RUN: %clangxx_hwasan %s -o %t
2#include <stddef.h>
3#include <new>
4
5char *__dummy;
6
7void *operator new(size_t size) { return __dummy; }
8void *operator new[](size_t size) { return __dummy; }
9void *operator new(size_t size, std::nothrow_t const&) noexcept {
10 return __dummy;
11}
12void *operator new[](size_t size, std::nothrow_t const&) noexcept {
13 return __dummy;
14}
15
16void operator delete(void *ptr) noexcept {}
17void operator delete[](void *ptr) noexcept {}
18void operator delete(void *ptr, std::nothrow_t const&) noexcept {}
19void operator delete[](void *ptr, std::nothrow_t const&) noexcept {}
20
21int main() {
22 return 0;
23}
24

source code of compiler-rt/test/hwasan/TestCases/override-new-delete.cpp