aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59667.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59667.c')
-rw-r--r--gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59667.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59667.c b/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59667.c
new file mode 100644
index 000000000..7fad70299
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/c-c++-common/ubsan/pr59667.c
@@ -0,0 +1,14 @@
+/* { dg-do run } */
+/* { dg-options "-fsanitize=undefined" } */
+/* { dg-shouldfail "ubsan" } */
+
+int
+main (void)
+{
+ unsigned int len = 1;
+ float (*P)[len][len] = 0;
+ (*P)[0][0] = 1;
+ return 0;
+}
+
+/* { dg-output "store to null pointer of type 'float'(\n|\r\n|\r)" } */