summaryrefslogtreecommitdiff
path: root/regress/gnu/egcs/gcc-bounds
diff options
context:
space:
mode:
authorAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-10-07 22:24:27 +0000
committerAnil Madhavapeddy <avsm@cvs.openbsd.org>2003-10-07 22:24:27 +0000
commit6628301891a6c202158f8acdda10d750a0e71cbc (patch)
treeda8f1953413bc85c46724aa537eba2988c5edc15 /regress/gnu/egcs/gcc-bounds
parentc76eb04ac867dbc8c6fbf9145f3b694883fb63e7 (diff)
add a few regression tests for the recently fixed md functions
Diffstat (limited to 'regress/gnu/egcs/gcc-bounds')
-rw-r--r--regress/gnu/egcs/gcc-bounds/Makefile6
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-1.c18
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-1.c.exp0
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-2.c17
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-2.c.exp0
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-3.c18
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-3.c.exp2
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-4.c17
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-4.c.exp2
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-5.c18
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-5.c.exp3
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-6.c17
-rw-r--r--regress/gnu/egcs/gcc-bounds/md-6.c.exp2
13 files changed, 118 insertions, 2 deletions
diff --git a/regress/gnu/egcs/gcc-bounds/Makefile b/regress/gnu/egcs/gcc-bounds/Makefile
index 1ad2154c22c..9e9b5faff16 100644
--- a/regress/gnu/egcs/gcc-bounds/Makefile
+++ b/regress/gnu/egcs/gcc-bounds/Makefile
@@ -1,6 +1,7 @@
-# $OpenBSD: Makefile,v 1.3 2003/09/05 20:50:29 avsm Exp $
+# $OpenBSD: Makefile,v 1.4 2003/10/07 22:24:26 avsm Exp $
-C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare sscanf vararray
+C_MODULES?= strlcpy strlcat getcwd memcpy fread memcpy declare \
+ sscanf vararray md
CPP_MODULES?= snprintf sscanf
C_STRLCPY= 1 2 3 4 5 6
@@ -11,6 +12,7 @@ C_FREAD= 1 2 3 4
C_DECLARE= 1 2 3 4 5 6 7 8 9 10 11 12 13
C_SSCANF= 1 2
C_VARARRAY= 1 2
+C_MD= 1 2 3 4 5 6
CPP_SNPRINTF= 1 2 3 4 5
CPP_SSCANF= 1
diff --git a/regress/gnu/egcs/gcc-bounds/md-1.c b/regress/gnu/egcs/gcc-bounds/md-1.c
new file mode 100644
index 00000000000..629486a524b
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-1.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <md5.h>
+
+const unsigned char data[] = "1234567890abcdefghijklmnopqrstuvwxyz";
+
+int
+main(int argc, char **argv)
+{
+ MD5_CTX ctx;
+ char *ret;
+
+ MD5Init(&ctx);
+ ret = MD5Data(data, sizeof data - 1, NULL);
+ printf("%s\n", ret);
+ free(ret);
+}
diff --git a/regress/gnu/egcs/gcc-bounds/md-1.c.exp b/regress/gnu/egcs/gcc-bounds/md-1.c.exp
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-1.c.exp
diff --git a/regress/gnu/egcs/gcc-bounds/md-2.c b/regress/gnu/egcs/gcc-bounds/md-2.c
new file mode 100644
index 00000000000..86fa059ac35
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-2.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <md4.h>
+
+const unsigned char data[] = "1234567890abcdefghijklmnopqrstuvwxyz";
+
+int
+main(int argc, char **argv)
+{
+ MD4_CTX ctx;
+ char ret[33];
+
+ MD4Init(&ctx);
+ MD4Data(data, sizeof data - 1, ret);
+ printf("%s\n", ret);
+}
diff --git a/regress/gnu/egcs/gcc-bounds/md-2.c.exp b/regress/gnu/egcs/gcc-bounds/md-2.c.exp
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-2.c.exp
diff --git a/regress/gnu/egcs/gcc-bounds/md-3.c b/regress/gnu/egcs/gcc-bounds/md-3.c
new file mode 100644
index 00000000000..a3d7364da89
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-3.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <md5.h>
+
+int
+main(int argc, char **argv)
+{
+ MD5_CTX ctx;
+ unsigned char *data = malloc(10);
+ char ret[33];
+
+ strlcpy(data, "123456789", 10);
+
+ MD5Init(&ctx);
+ MD5Data(data, sizeof data, ret);
+ printf("%s\n", ret);
+}
diff --git a/regress/gnu/egcs/gcc-bounds/md-3.c.exp b/regress/gnu/egcs/gcc-bounds/md-3.c.exp
new file mode 100644
index 00000000000..f3797804127
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-3.c.exp
@@ -0,0 +1,2 @@
+md-3.c: In function `main':
+md-3.c:16: warning: sizeof(pointer) possibly incorrect in argument 2
diff --git a/regress/gnu/egcs/gcc-bounds/md-4.c b/regress/gnu/egcs/gcc-bounds/md-4.c
new file mode 100644
index 00000000000..06fb2e18fde
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-4.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <md5.h>
+
+const unsigned char data[] = "1234567890abcdefghijklmnopqrstuvwxyz";
+
+int
+main(int argc, char **argv)
+{
+ MD5_CTX ctx;
+ char ret[10];
+
+ MD5Init(&ctx);
+ MD5Data(data, sizeof data - 1, ret);
+ printf("%s\n", ret);
+}
diff --git a/regress/gnu/egcs/gcc-bounds/md-4.c.exp b/regress/gnu/egcs/gcc-bounds/md-4.c.exp
new file mode 100644
index 00000000000..8229028502f
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-4.c.exp
@@ -0,0 +1,2 @@
+md-4.c: In function `main':
+md-4.c:15: warning: array size (10) is smaller than minimum required (33)
diff --git a/regress/gnu/egcs/gcc-bounds/md-5.c b/regress/gnu/egcs/gcc-bounds/md-5.c
new file mode 100644
index 00000000000..e1d0538b106
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-5.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <rmd160.h>
+
+int
+main(int argc, char **argv)
+{
+ RMD160_CTX ctx;
+ unsigned char *data = malloc(10);
+ char ret[32];
+
+ strlcpy(data, "123456789", 10);
+
+ RMD160Init(&ctx);
+ RMD160Data(data, sizeof data, ret);
+ printf("%s\n", ret);
+}
diff --git a/regress/gnu/egcs/gcc-bounds/md-5.c.exp b/regress/gnu/egcs/gcc-bounds/md-5.c.exp
new file mode 100644
index 00000000000..9f3e82cae73
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-5.c.exp
@@ -0,0 +1,3 @@
+md-5.c: In function `main':
+md-5.c:16: warning: array size (32) is smaller than minimum required (41)
+md-5.c:16: warning: sizeof(pointer) possibly incorrect in argument 2
diff --git a/regress/gnu/egcs/gcc-bounds/md-6.c b/regress/gnu/egcs/gcc-bounds/md-6.c
new file mode 100644
index 00000000000..5ed36c5460d
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-6.c
@@ -0,0 +1,17 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sha1.h>
+
+const unsigned char data[] = "1234567890abcdefghijklmnopqrstuvwxyz";
+
+int
+main(int argc, char **argv)
+{
+ SHA1_CTX ctx;
+ char ret[20];
+
+ SHA1Init(&ctx);
+ SHA1Data(data, sizeof data - 1, ret);
+ printf("%s\n", ret);
+}
diff --git a/regress/gnu/egcs/gcc-bounds/md-6.c.exp b/regress/gnu/egcs/gcc-bounds/md-6.c.exp
new file mode 100644
index 00000000000..c0dcb0c10f8
--- /dev/null
+++ b/regress/gnu/egcs/gcc-bounds/md-6.c.exp
@@ -0,0 +1,2 @@
+md-6.c: In function `main':
+md-6.c:15: warning: array size (20) is smaller than minimum required (41)