aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/asan/pr61530.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/asan/pr61530.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/asan/pr61530.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/asan/pr61530.c b/gcc-4.9/gcc/testsuite/c-c++-common/asan/pr61530.c
new file mode 100644
index 000000000..e306a71be
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/asan/pr61530.c
@@ -0,0 +1,17 @@
+/* { dg-do run } */
+/* { dg-shouldfail "asan" } */
+
+__attribute__((noinline,noclone)) void
+foo (char *a, char *b) {
+ a[0] = b[0] = 0;
+ __builtin_memcpy(a, b, 4);
+}
+
+int
+main () {
+ char a, b;
+ foo (&a, &b);
+ return 0;
+}
+
+/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow" } */