CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
78 lines
2.8 KiB
C++
78 lines
2.8 KiB
C++
/// From sanitizer_common/TestCases/Linux/new_delete_test.cpp
|
|
// RUN: %clangxx_nsan -fno-sized-deallocation -O0 %s -o %t && %run %t
|
|
// RUN: %clangxx_nsan -fsized-deallocation -O0 %s -o %t && %run %t
|
|
|
|
#include <cstddef>
|
|
|
|
namespace std {
|
|
struct nothrow_t {};
|
|
static const nothrow_t nothrow;
|
|
enum class align_val_t : size_t {};
|
|
} // namespace std
|
|
|
|
void *operator new(size_t);
|
|
void *operator new[](size_t);
|
|
void *operator new(size_t, std::nothrow_t const &);
|
|
void *operator new[](size_t, std::nothrow_t const &);
|
|
void *operator new(size_t, std::align_val_t);
|
|
void *operator new[](size_t, std::align_val_t);
|
|
void *operator new(size_t, std::align_val_t, std::nothrow_t const &);
|
|
void *operator new[](size_t, std::align_val_t, std::nothrow_t const &);
|
|
|
|
void operator delete(void *) throw();
|
|
void operator delete[](void *) throw();
|
|
void operator delete(void *, std::nothrow_t const &);
|
|
void operator delete[](void *, std::nothrow_t const &);
|
|
void operator delete(void *, size_t) throw();
|
|
void operator delete[](void *, size_t) throw();
|
|
void operator delete(void *, std::align_val_t) throw();
|
|
void operator delete[](void *, std::align_val_t) throw();
|
|
void operator delete(void *, std::align_val_t, std::nothrow_t const &);
|
|
void operator delete[](void *, std::align_val_t, std::nothrow_t const &);
|
|
void operator delete(void *, size_t, std::align_val_t) throw();
|
|
void operator delete[](void *, size_t, std::align_val_t) throw();
|
|
|
|
template <typename T> inline T *break_optimization(T *arg) {
|
|
__asm__ __volatile__("" : : "r"(arg) : "memory");
|
|
return arg;
|
|
}
|
|
|
|
struct S12 {
|
|
int a, b, c;
|
|
};
|
|
struct alignas(128) S12_128 {
|
|
int a, b, c;
|
|
};
|
|
struct alignas(256) S12_256 {
|
|
int a, b, c;
|
|
};
|
|
struct alignas(512) S1024_512 {
|
|
char a[1024];
|
|
};
|
|
struct alignas(1024) S1024_1024 {
|
|
char a[1024];
|
|
};
|
|
|
|
int main(int argc, char **argv) {
|
|
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)));
|
|
}
|