blob: 81ead05c506930708b0c946a6d885b176c71430e [file] [log] [blame]
Stephen Hines86277eb2015-03-23 12:06:32 -07001// Make sure symbolization works even if the path to the .exe file changes.
2// RUN: mkdir %t || true
3// RUN: %clang_cl_asan -O0 %s -Fe%t/symbols_path.exe
4// RUN: not %run %t/symbols_path.exe 2>&1 | FileCheck %s
5// RUN: mkdir %t2 || true
6// RUN: mv %t/* %t2
7// RUN: not %run %t2/symbols_path.exe 2>&1 | FileCheck %s
8
9#include <malloc.h>
10
11int main() {
12 char *buffer = (char*)malloc(42);
13 buffer[-1] = 42;
14// CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
15// CHECK: WRITE of size 1 at [[ADDR]] thread T0
16// CHECK-NEXT: {{#0 .* main .*symbols_path.cc}}:[[@LINE-3]]
17// CHECK: [[ADDR]] is located 1 bytes to the left of 42-byte region
18// CHECK: allocated by thread T0 here:
Pirama Arumuga Nainar799172d2016-03-03 15:50:30 -080019// CHECK-NEXT: {{#0 .* malloc}}
Stephen Hines86277eb2015-03-23 12:06:32 -070020// CHECK-NEXT: {{#1 .* main .*symbols_path.cc}}:[[@LINE-8]]
21 free(buffer);
22}