1/* { dg-options "-fdump-tree-sanopt" } */
2/* { dg-do compile } */
3/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
4
5void
6foo  (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  /* For a total of 2 checks.  */
11  int d = c[0] == 1;
12}
13
14/* { dg-final { scan-tree-dump-times "& 7" 2 "sanopt" } } */
15/* { dg-final { scan-tree-dump-times "__builtin___asan_report_load1" 1 "sanopt" } } */
16/* { dg-final { scan-tree-dump-times "__builtin___asan_report_load4" 1 "sanopt" } } */
17/* { dg-final { cleanup-tree-dump "sanopt" } } */
18