2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / strip-path-prefix-1.c
blob812aa37e2d0e4fb10b6637b5410d8522c3d125cb
1 /* { dg-do run } */
2 /* { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
3 /* { dg-set-target-env-var ASAN_OPTIONS "strip_path_prefix='/'" } */
4 /* { dg-options "-fno-builtin-malloc -fno-builtin-free" } */
5 /* { dg-shouldfail "asan" } */
7 #include <stdlib.h>
8 int main() {
9 char *x = (char*)malloc(10);
10 free(x);
11 return x[5];
14 /* { dg-output "heap-use-after-free.*(\n|\r\n|\r)" } */
15 /* { dg-output " #0 0x\[0-9a-f\]+ \[(\]?\[^/\]\[^\n\r]*(\n|\r\n|\r)" } */