]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/asan/TestCases/strip_path_prefix.c
Import compiler-rt 3.7.0 release (r246257).
[FreeBSD/FreeBSD.git] / test / asan / TestCases / strip_path_prefix.c
1 // RUN: %clang_asan -O2 %s -o %t
2 // RUN: env ASAN_OPTIONS="$ASAN_OPTIONS:strip_path_prefix='%S/'" not %run %t 2>&1 | FileCheck %s
3
4 #include <stdlib.h>
5 int main() {
6   char *x = (char*)malloc(10 * sizeof(char));
7   free(x);
8   return x[5];
9   // Check that paths in error report don't start with slash.
10   // CHECK: heap-use-after-free
11   // CHECK: #0 0x{{.*}} in main strip_path_prefix.c:[[@LINE-3]]
12 }