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" } */
6 
7 #include <stdlib.h>
main()8 int main() {
9   char *x = (char*)malloc(10);
10   free(x);
11   return x[5];
12 }
13 
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)" } */
16