2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / c-c++-common / asan / no-redundant-instrumentation-3.c
blob420a26309025a221660812a90761bcb0bb90ba94
1 /* { dg-options "-fdump-tree-asan0" } */
2 /* { dg-do compile } */
3 /* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
5 char
6 foo (__INT32_TYPE__ *p)
8 /* This generates a __builtin___asan_report_load1. */
9 __INT32_TYPE__ ret = *(char *) p;
10 /* This generates a __builtin___asan_report_store4 depending on the. */
11 *p = 26;
12 return ret;
15 /* { dg-final { scan-tree-dump-times "__builtin___asan_report" 2 "asan0" } } */
16 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_load1" 1 "asan0" } } */
17 /* { dg-final { scan-tree-dump-times "__builtin___asan_report_store" 1 "asan0" } } */
18 /* { dg-final { cleanup-tree-dump "asan0" } } */