aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c b/gcc-4.9/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c
new file mode 100644
index 000000000..420a26309
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/asan/no-redundant-instrumentation-3.c
@@ -0,0 +1,18 @@
+/* { dg-options "-fdump-tree-asan0" } */
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+
+char
+foo (__INT32_TYPE__ *p)
+{
+ /* This generates a __builtin___asan_report_load1. */
+ __INT32_TYPE__ ret = *(char *) p;
+ /* This generates a __builtin___asan_report_store4 depending on the. */
+ *p = 26;
+ return ret;
+}
+
+/* { dg-final { scan-tree-dump-times "__builtin___asan_report" 2 "asan0" } } */
+/* { dg-final { scan-tree-dump-times "__builtin___asan_report_load1" 1 "asan0" } } */
+/* { dg-final { scan-tree-dump-times "__builtin___asan_report_store" 1 "asan0" } } */
+/* { dg-final { cleanup-tree-dump "asan0" } } */