Rebase.
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / no-redundant-instrumentation-6.c
blob55c8ee376b525c3e554ef6f4b3e50e03ed9368c5
1 /* { dg-options "-fdump-tree-asan0" } */
2 /* { dg-do compile } */
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 void
6 foo (int *a, char *b, char *c)
8 /* One check for c[0], one check for a[], one check for c and 2 checks for b. */
9 __builtin_memmove (c, b, a[c[0]]);
10 /* One check for a[], one check for c and one check for b. */
11 __builtin_memmove (c, b, a[b[0]]);
12 /* For a total of 8 checks. */
15 /* { dg-final { scan-tree-dump-times "& 7" 8 "asan0" } } */
16 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load1" 1 "asan0" } } */
17 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load4" 2 "asan0" } } */
18 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load_n" 2 "asan0" } } */
19 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_store_n" 2 "asan0" } } */
20 /* { dg-final { cleanup-tree-dump "asan0" } } */