(root)/
gcc-13.2.0/
gcc/
testsuite/
c-c++-common/
asan/
pr70712.c
       1  /* PR sanitizer/70712 */
       2  /* { dg-do run } */
       3  
       4  struct __attribute__((aligned (64))) S
       5  {
       6    char s[4];
       7  };
       8  
       9  struct T
      10  {
      11    char t[8];
      12    char u[480];
      13  
      14  };
      15  
      16  __attribute__((noinline, noclone)) void
      17  foo (struct T *p, struct S *q)
      18  {
      19    __builtin_memset (p->t, '\0', sizeof (p->t));
      20    __builtin_memset (p->u, '\0', sizeof (p->u));
      21    __builtin_memset (q->s, '\0', sizeof (q->s));
      22  }
      23  
      24  int
      25  main ()
      26  {
      27    struct S s;
      28    struct T t;
      29    foo (&t, &s);
      30    asm volatile ("" : : "r" (&t), "r" (&s) : "memory");
      31    return 0;
      32  }