gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-12.c
raw| 1 | /* { dg-options "-fdump-tree-sanopt" } */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */ |
| 4 | |
| 5 | void |
| 6 | foo (char *p) |
| 7 | { |
| 8 | volatile int zero = 0; |
| 9 | __builtin_memcpy (p, "abc", zero); |
| 10 | /* This generates a __builtin___asan_report_store1 because we pass volatile |
| 11 | zero length into memcpy. */ |
| 12 | p[0] = 'd'; |
| 13 | } |
| 14 | |
| 15 | /* { dg-final { scan-tree-dump-times "__builtin___asan_report_store1" 1 "sanopt" } } */ |