aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/asan/strip-path-prefix-1.c
blob: 812aa37e2d0e4fb10b6637b5410d8522c3d125cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
/* { dg-set-target-env-var ASAN_OPTIONS "strip_path_prefix='/'" } */
/* { dg-options "-fno-builtin-malloc -fno-builtin-free" } */
/* { dg-shouldfail "asan" } */

#include <stdlib.h>
int main() {
  char *x = (char*)malloc(10);
  free(x);
  return x[5];
}

/* { dg-output "heap-use-after-free.*(\n|\r\n|\r)" } */
/* { dg-output "    #0 0x\[0-9a-f\]+ \[(\]?\[^/\]\[^\n\r]*(\n|\r\n|\r)" } */