2 /* { dg-require-effective-target hwaddress_exec } */
3 /* { dg-options "-fno-builtin-malloc -fno-builtin-free" } */
4 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 /* { dg-shouldfail "hwasan" } */
11 extern void *malloc (__SIZE_TYPE__
);
12 extern void free (void *);
21 int f(struct Simple simple
) {
26 struct Simple
*psimple
= (struct Simple
*) malloc(sizeof(struct Simple
));
29 printf("%d\n", f(*psimple
));
33 /* { dg-output "HWAddressSanitizer: tag-mismatch on address 0x\[0-9a-f\]*.*" } */
34 /* { dg-output "READ of size 4 at 0x\[0-9a-f\]* tags: \[\[:xdigit:\]\]\[\[:xdigit:\]\]/\[\[:xdigit:\]\]\[\[:xdigit:\]\] \\(ptr/mem\\) in thread T0.*" } */
35 /* { dg-output "freed by thread T0 here:.*" } */
36 /* { dg-output "previously allocated by thread T0 here:" } */