summaryrefslogtreecommitdiff
path: root/regress/gnu
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2010-05-14 09:59:54 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2010-05-14 09:59:54 +0000
commit81d6ce9ad97774ac96b484f20be78a8f886a461c (patch)
tree1ff39c0c80fdf82b089a0c421e59765066c0a1b8 /regress/gnu
parent4de3bb663ea6efb8d2dd9d5bc7e2c06aa9808b4f (diff)
add failing regress test for gcc3 -Wbounded for 0-length arrays, spotted by nicm@
Diffstat (limited to 'regress/gnu')
-rw-r--r--regress/gnu/egcs/gcc-bounds/Makefile4
-rw-r--r--regress/gnu/egcs/gcc-bounds/memcpy-8.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/Makefile b/regress/gnu/egcs/gcc-bounds/Makefile
index d0026aa8ddf..bd639639460 100644
--- a/regress/gnu/egcs/gcc-bounds/Makefile
+++ b/regress/gnu/egcs/gcc-bounds/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.11 2010/05/10 18:20:31 drahn Exp $
+# $OpenBSD: Makefile,v 1.12 2010/05/14 09:59:53 avsm Exp $
C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare \
sscanf vararray md builtins
@@ -7,7 +7,7 @@ CPP_MODULES?= snprintf sscanf
C_STRLCPY= 1 2 3 4 5 6
C_STRLCAT= 1 2 3 4 5 6
C_GETCWD= 1 2 3 4
-C_MEMCPY= 1 2 3 4 5 6
+C_MEMCPY= 1 2 3 4 5 6 8
C_FREAD= 1 2 3 4
C_DECLARE= 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
C_SSCANF= 1 2 3 4 5 6
diff --git a/regress/gnu/egcs/gcc-bounds/memcpy-8.c b/regress/gnu/egcs/gcc-bounds/memcpy-8.c
new file mode 100644
index 00000000000..139a17dd8c9
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/memcpy-8.c
@@ -0,0 +1,8 @@
+#include <string.h>
+
+int main(int argc, char **argv) {
+ char buf[0];
+ char buf2[0];
+ memcpy(buf, buf2, sizeof buf);
+ return 1;
+}