Revert "[lldb][test] Remove compiler version check and use regex" (#124101)
[llvm-project.git] / compiler-rt / test / hwasan / TestCases / sanitizer_malloc.cpp
blobcf1dc0741beadda64d8ce9341abcbf9efbc17783
1 // Test allocator aliases.
2 //
3 // RUN: %clangxx_hwasan -O0 %s -o %t && %run %t
5 #include <sanitizer/hwasan_interface.h>
7 int main() {
8 void *volatile sink;
9 sink = (void *)&__sanitizer_posix_memalign;
10 sink = (void *)&__sanitizer_memalign;
11 sink = (void *)&__sanitizer_aligned_alloc;
12 sink = (void *)&__sanitizer___libc_memalign;
13 sink = (void *)&__sanitizer_valloc;
14 sink = (void *)&__sanitizer_pvalloc;
15 sink = (void *)&__sanitizer_free;
16 sink = (void *)&__sanitizer_cfree;
17 sink = (void *)&__sanitizer_malloc_usable_size;
18 sink = (void *)&__sanitizer_mallinfo;
19 sink = (void *)&__sanitizer_mallopt;
20 sink = (void *)&__sanitizer_malloc_stats;
21 sink = (void *)&__sanitizer_calloc;
22 sink = (void *)&__sanitizer_realloc;
23 sink = (void *)&__sanitizer_reallocarray;
24 sink = (void *)&__sanitizer_malloc;
26 // sanity check
27 void *p = __sanitizer_malloc(100);
28 p = __sanitizer_realloc(p, 200);
29 __sanitizer_free(p);