FreeBSD regtest: add fakes for older versions in scalar
[valgrind.git] / memcheck / tests / new_delete_mismatch_size.cpp
blobd7c559086e428e252c1414c05dd960d16782d10f
1 #include <cstdlib>
2 #include <new>
3 #include <iostream>
4 #include <cassert>
5 #include <cstdio>
6 #include <unistd.h>
7 #include <sys/types.h>
8 #include <sys/wait.h>
9 #include "valgrind.h"
11 int main() {
12 std::align_val_t align(static_cast<std::align_val_t>(64U));
13 size_t size(32);
14 size_t badsize(33);
15 void *mem = nullptr;
17 mem = operator new(size);
18 operator delete(mem, badsize);
19 mem = nullptr;
21 mem = operator new[](size);
22 operator delete[](mem, badsize);
24 mem = operator new(size, align);
25 operator delete(mem, badsize, align);
26 mem = nullptr;
28 mem = operator new[](size, align);
29 operator delete[](mem, badsize, align);