1  /* { dg-options "-fdump-tree-sanopt" } */
       2  /* { dg-do compile } */
       3  /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
       4  
       5  void
       6  foo  (int *a, char *b, char *c)
       7  {
       8    /* One check for c[0], one check for a[].  */
       9    __builtin_memmove (c, b, a[c[0]]);
      10    /* One check for b[0], one check for a[].  */
      11    __builtin_memmove (c, b, a[b[0]]);
      12    /* For a total of 4 checks.  */
      13    int d = c[0] == b[0];
      14  }
      15  
      16  /* { dg-final { scan-tree-dump-times "& 7" 4 "sanopt" } } */
      17  /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load1" 2 "sanopt" } } */
      18  /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load4" 2 "sanopt" } } */