brintos

brintos / llvm-project-archived public Read only

0
0
Text · 756 B · 6a7d2e9 Raw
26 lines · cpp
1// RUN: rm -rf %t; mkdir %t2// RUN: %clang_hwasan -Wl,--build-id -g %s -o %t/hwasan_uas3// RUN: %env_hwasan_opts=symbolize=0 not %run %t/hwasan_uas 2>&1 | hwasan_symbolize --symbols %t --index | FileCheck %s4 5// This doesn't work on X86, because that uses instrument-with-calls which6// disables frame records.7// REQUIRES: aarch64-target-arch8 9#include <sanitizer/hwasan_interface.h>10#include <stdlib.h>11 12static volatile char sink;13 14int main(int argc, char **argv) {15  volatile char *y;16  {17    volatile char x[10];18    y = &x[0];19  }20  sink = *y;21  // CHECK: Potentially referenced stack object:22  // CHECK:   0 bytes inside a variable "x" in stack frame of function "main"23  // CHECK:   at {{.*}}hwasan_symbolize_stack_uas.cpp:[[@LINE-6]]24  return 0;25}26