1 // RUN: %clangxx_asan %s -o %t
2 // RUN: not %run %t 2>&1 | FileCheck %s
3 // REQUIRES: asan-64-bits
13 char *dest
= new char;
14 const size_t offset
= 0x4567890123456789;
16 // The output here needs to match the output from the sanitizer runtime,
17 // which includes 0x and prints hex in lower case.
19 // On Windows, %p omits %0x and prints hex characters in upper case,
20 // so we use PRIxPTR instead of %p.
21 fprintf(stderr
, "Expected bad addr: %#" PRIxPTR
"\n",
22 reinterpret_cast<uintptr_t>(p
+ offset
));
23 // Flush it so the output came out before the asan report.
26 memmove(dest
, p
, offset
);
30 // CHECK: Expected bad addr: [[ADDR:0x[0-9,a-f]+]]
31 // CHECK: AddressSanitizer: unknown-crash on address [[ADDR]]
32 // CHECK: Address [[ADDR]] is a wild pointer inside of access range of size 0x4567890123456789