Nico Weber f9e0df071e compiler-rt: Rename .cc file in test/hwasan to .cpp
Like r367463, but for test/hwasan.

llvm-svn: 367849
2019-08-05 13:10:50 +00:00

19 lines
404 B
C++

// Test basic new functionality.
// RUN: %clangxx_hwasan %s -o %t
// RUN: %run %t
#include <stdlib.h>
#include <assert.h>
#include <sanitizer/hwasan_interface.h>
#include <sanitizer/allocator_interface.h>
int main() {
__hwasan_enable_allocator_tagging();
size_t volatile n = 0;
char *a1 = new char[n];
assert(a1 != nullptr);
assert(__sanitizer_get_allocated_size(a1) == 0);
delete[] a1;
}