view gcc/testsuite/c-c++-common/asan/pr63316.c @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
children
line wrap: on
line source

/* PR sanitizer/63316 */
/* { dg-do run } */
/* { dg-skip-if "" { *-*-* }  { "*" } { "-O2" } } */

#ifdef __cplusplus
extern "C" {
#endif
extern void *malloc (__SIZE_TYPE__);
extern void free (void *);
#ifdef __cplusplus
}
#endif

int
main ()
{
  int *p = (int *) malloc (sizeof (int));
  *p = 3;
  asm volatile ("" : : "r" (p) : "memory");
  free (p);
  return 0;
}