1 // RUN: %clangxx_asan %s -o %t 2 // RUN: not %run %t 2>&1 | FileCheck %s 3 // REQUIRES: asan-64-bits 4 5 #include <stdarg.h> 6 #include <stdio.h> 7 #include <string.h> 8 9 int main() { 10 char *p = new char; 11 char *dest = new char; 12 const size_t offset = 0x4567890123456789; 13 // Flush it so the output came out before the asan report. 14 fprintf(stderr, "Expected bad addr: %p\n", p + offset); 15 fflush(stderr); 16 memmove(dest, p, offset); 17 return 0; 18 } 19 20 // CHECK: Expected bad addr: [[ADDR:0x[0-9,a-f]+]] 21 // CHECK: AddressSanitizer: unknown-crash on address [[ADDR]] 22 // CHECK: Address [[ADDR]] is a wild pointer inside of access range of size 0x4567890123456789 23