1 // RUN: %clangxx_hwasan -mllvm -hwasan-use-stack-safety=0 -mllvm -hwasan-use-after-scope -O2 %s -o %t && \
4 // REQUIRES: aarch64-target-arch
5 // REQUIRES: stable-runtime
7 #include <sanitizer/hwasan_interface.h>
12 #include <sys/types.h>
15 volatile const char *stackbuf
= nullptr;
18 __attribute__((noinline
)) bool jump() {
19 // Fool the compiler so it cannot deduce noreturn.
28 switch (setjmp(jbuf
)) {
48 void *untagged
= __hwasan_tag_pointer(stackbuf
, 0);
49 if (stackbuf
== untagged
) {
50 // The buffer wasn't tagged in the first place, so the test will not work
54 if (__hwasan_test_shadow(untagged
, 4096) != -1) {