diff options
author | Florian Mayer <fmayer@google.com> | 2024-06-13 09:56:45 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 09:56:45 -0700 |
commit | 389142efa0976436aa9210af014a5c92bcb53cdd (patch) | |
tree | 8c4152019a15be1309c97073d463f6bd3da94853 /compiler-rt | |
parent | 0f53a59fa6b4a7828cf6dbabb0056a379cdc4d0a (diff) | |
download | llvm-389142efa0976436aa9210af014a5c92bcb53cdd.zip llvm-389142efa0976436aa9210af014a5c92bcb53cdd.tar.gz llvm-389142efa0976436aa9210af014a5c92bcb53cdd.tar.bz2 |
[HWASan] add test for hwasan_symbolize of stack uas (#95186)
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/test/hwasan/TestCases/hwasan_symbolize_stack_uas.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/compiler-rt/test/hwasan/TestCases/hwasan_symbolize_stack_uas.cpp b/compiler-rt/test/hwasan/TestCases/hwasan_symbolize_stack_uas.cpp new file mode 100644 index 0000000..500bc71 --- /dev/null +++ b/compiler-rt/test/hwasan/TestCases/hwasan_symbolize_stack_uas.cpp @@ -0,0 +1,22 @@ +// RUN: %clang_hwasan -Wl,--build-id -g %s -o %t +// RUN: %env_hwasan_opts=symbolize=0 not %run %t 2>&1 | hwasan_symbolize --symbols $(dirname %t) --index | FileCheck %s + +// REQUIRES: pointer-tagging + +#include <sanitizer/hwasan_interface.h> +#include <stdlib.h> + +static volatile char sink; + +int main(int argc, char **argv) { + volatile char *y; + { + volatile char x[10]; + y = &x[0]; + } + sink = *y; + // CHECK: Potentially referenced stack object: + // CHECK: 0 bytes inside a variable "x" in stack frame of function "main" + // CHECK: at {{.*}}hwasan_symbolize_stack_uas.cpp:[[@LINE-6]] + return 0; +} |