Index: lib/hwasan/hwasan.cc =================================================================== --- lib/hwasan/hwasan.cc +++ lib/hwasan/hwasan.cc @@ -306,7 +306,7 @@ } } -void __hwasan_load(uptr p, uptr sz) { +void __hwasan_loadN(uptr p, uptr sz) { CheckAddressSized(p, sz); } void __hwasan_load1(uptr p) { @@ -325,7 +325,7 @@ CheckAddress(p); } -void __hwasan_load_noabort(uptr p, uptr sz) { +void __hwasan_loadN_noabort(uptr p, uptr sz) { CheckAddressSized(p, sz); } void __hwasan_load1_noabort(uptr p) { @@ -344,7 +344,7 @@ CheckAddress(p); } -void __hwasan_store(uptr p, uptr sz) { +void __hwasan_storeN(uptr p, uptr sz) { CheckAddressSized(p, sz); } void __hwasan_store1(uptr p) { @@ -363,7 +363,7 @@ CheckAddress(p); } -void __hwasan_store_noabort(uptr p, uptr sz) { +void __hwasan_storeN_noabort(uptr p, uptr sz) { CheckAddressSized(p, sz); } void __hwasan_store1_noabort(uptr p) { Index: lib/hwasan/hwasan_interface_internal.h =================================================================== --- lib/hwasan/hwasan_interface_internal.h +++ lib/hwasan/hwasan_interface_internal.h @@ -32,7 +32,7 @@ using __sanitizer::u8; SANITIZER_INTERFACE_ATTRIBUTE -void __hwasan_load(uptr, uptr); +void __hwasan_loadN(uptr, uptr); SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_load1(uptr); SANITIZER_INTERFACE_ATTRIBUTE @@ -45,7 +45,7 @@ void __hwasan_load16(uptr); SANITIZER_INTERFACE_ATTRIBUTE -void __hwasan_load_noabort(uptr, uptr); +void __hwasan_loadN_noabort(uptr, uptr); SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_load1_noabort(uptr); SANITIZER_INTERFACE_ATTRIBUTE @@ -58,7 +58,7 @@ void __hwasan_load16_noabort(uptr); SANITIZER_INTERFACE_ATTRIBUTE -void __hwasan_store(uptr, uptr); +void __hwasan_storeN(uptr, uptr); SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_store1(uptr); SANITIZER_INTERFACE_ATTRIBUTE @@ -71,7 +71,7 @@ void __hwasan_store16(uptr); SANITIZER_INTERFACE_ATTRIBUTE -void __hwasan_store_noabort(uptr, uptr); +void __hwasan_storeN_noabort(uptr, uptr); SANITIZER_INTERFACE_ATTRIBUTE void __hwasan_store1_noabort(uptr); SANITIZER_INTERFACE_ATTRIBUTE Index: test/hwasan/TestCases/check-interface.cc =================================================================== --- /dev/null +++ test/hwasan/TestCases/check-interface.cc @@ -0,0 +1,22 @@ +// RUN: %clangxx_hwasan -mllvm -hwasan-instrument-with-calls=1 -O0 %s -o %t +// RUN: %clangxx_hwasan -mllvm -hwasan-instrument-with-calls=1 -O0 %s -o %t -fsanitize-recover=hwaddress + +// REQUIRES: stable-runtime + +// Utilizes all flavors of __hwasan_load/store interface functions to verify +// that the instrumentation and the interface provided by HWASan do match. +// In case of a discrepancy, this test fails to link. + +#include + +#define F(T) void f_##T(T *a, T *b) { *a = *b; } + +F(uint8_t) +F(uint16_t) +F(uint32_t) +F(uint64_t) + +typedef unsigned V32 __attribute__((__vector_size__(32))); +F(V32) + +int main() {}