summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/asan/pr105396.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/gcc.dg/asan/pr105396.c')
-rw-r--r--gcc/testsuite/gcc.dg/asan/pr105396.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/asan/pr105396.c b/gcc/testsuite/gcc.dg/asan/pr105396.c
new file mode 100644
index 00000000000..d4bd7f12476
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/asan/pr105396.c
@@ -0,0 +1,19 @@
+/* PR sanitizer/105396 */
+/* { dg-do run } */
+/* { dg-skip-if "" { *-*-* } { "*" } { "-O0" } } */
+/* { dg-shouldfail "asan" } */
+
+int
+main ()
+{
+ int a;
+ int *b[1];
+ int c[10];
+ int d[1][1];
+ for (a = 0; a < 1; a++)
+ d[1][a] = 0;
+ return 0;
+}
+
+/* { dg-output "ERROR: AddressSanitizer: stack-buffer-overflow on address.*(\n|\r\n|\r)" } */
+/* { dg-output "WRITE of size.*" } */