Sync with upstream 4.9 branch
[official-gcc.git] / embedded-4_9-branch / gcc / testsuite / c-c++-common / asan / no-redundant-instrumentation-5.c
blob077ea34d028e869d1fd50cc419fc13ba9115803e
1 /* { dg-options "-fdump-tree-sanopt" } */
2 /* { dg-do compile } */
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 void
6 foo (int *a, char *b, char *c)
8 /* One check for b[0], one check for a[], 2 checks for c and one checks for b. */
9 __builtin_memmove (c, b, a[b[0]]);
10 /* For a total of 5 checks. */
13 /* { dg-final { scan-tree-dump-times "& 7" 5 "sanopt" } } */
14 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load1" 1 "sanopt" } } */
15 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load4" 1 "sanopt" } } */
16 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load_n" 1 "sanopt" } } */
17 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_store_n" 1 "sanopt" } } */
18 /* { dg-final { cleanup-tree-dump "sanopt" } } */