diff options
Diffstat (limited to 'compiler-rt/test/hwasan/TestCases/check-interface.cpp')
| -rw-r--r-- | compiler-rt/test/hwasan/TestCases/check-interface.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/test/hwasan/TestCases/check-interface.cpp b/compiler-rt/test/hwasan/TestCases/check-interface.cpp new file mode 100644 index 00000000000..7ad91148035 --- /dev/null +++ b/compiler-rt/test/hwasan/TestCases/check-interface.cpp @@ -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 <sanitizer/hwasan_interface.h> + +#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() {} |

