Blame SOURCES/memstomp-testsuite.patch

aac10c
diff -Nrup a/Makefile.am b/Makefile.am
aac10c
--- a/Makefile.am	2011-03-30 21:27:19.000000000 -0600
aac10c
+++ b/Makefile.am	2013-03-11 15:31:08.909891995 -0600
aac10c
@@ -86,3 +86,24 @@ dist-gzip:
aac10c
 	(cd $(srcdir); git archive --prefix=memstomp-$(VERSION)/ --format=tar HEAD) | gzip > memstomp-$(VERSION).tar.gz
aac10c
 
aac10c
 ACLOCAL_AMFLAGS = -I m4
aac10c
+
aac10c
+check-DEJAGNU: site.exp
aac10c
+	if [ -d testsuite ]; then \
aac10c
+	  true; \
aac10c
+	else \
aac10c
+	  mkdir testsuite; \
aac10c
+	fi
aac10c
+	rm -f testsuite/site.exp
aac10c
+	cp site.exp testsuite/site.exp
aac10c
+	rootme=`pwd`; export rootme; \
aac10c
+	srcdir=`cd ${srcdir}; pwd` ; export srcdir ; \
aac10c
+	LC_ALL=C; export LC_ALL; \
aac10c
+	EXPECT=${EXPECT} ; export EXPECT ; \
aac10c
+	runtest=$(RUNTEST); \
aac10c
+	cd testsuite; \
aac10c
+	if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
aac10c
+	  $$runtest --tool $(DEJATOOL) --srcdir $${srcdir}/testsuite \
aac10c
+		$(RUNTESTFLAGS); \
aac10c
+	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
aac10c
+	fi
aac10c
+
aac10c
diff -Nrup a/configure.ac b/configure.ac
aac10c
--- a/configure.ac	2011-03-30 21:27:19.000000000 -0600
aac10c
+++ b/configure.ac	2013-03-11 15:27:32.812194998 -0600
aac10c
@@ -25,7 +25,7 @@ AC_CONFIG_SRCDIR([memstomp.c])
aac10c
 AC_CONFIG_HEADERS([config.h])
aac10c
 AC_CONFIG_MACRO_DIR(m4)
aac10c
 
aac10c
-AM_INIT_AUTOMAKE([foreign 1.10 -Wall -Wno-portability tar-pax])
aac10c
+AM_INIT_AUTOMAKE([foreign 1.10 -Wall -Wno-portability tar-pax dejagnu])
aac10c
 
aac10c
 AC_SUBST(PACKAGE_URL, [http://wcohen.fedorapeople.org/git/memstomp/])
aac10c
 
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/memccpy.c b/testsuite/memstomp.nooverlap/memccpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/memccpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/memccpy.c	2013-03-11 14:13:05.000000000 -0600
aac10c
@@ -0,0 +1,20 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef MEMCCPY
aac10c
+#define MEMCCPY memccpy
aac10c
+#define TYPE char
aac10c
+#endif
aac10c
+
aac10c
+TYPE arr1[10] = {0};
aac10c
+TYPE arr2[10] = {0};
aac10c
+TYPE *p1 = &arr1[0];
aac10c
+TYPE *p2 = &arr2[1];
aac10c
+size_t count = 9;
aac10c
+main ()
aac10c
+{
aac10c
+  MEMCCPY (p1, p2, -1, count);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/memcpy.c b/testsuite/memstomp.nooverlap/memcpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/memcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/memcpy.c	2013-03-11 14:12:57.000000000 -0600
aac10c
@@ -0,0 +1,20 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef MEMCPY
aac10c
+#define MEMCPY memcpy
aac10c
+#define TYPE char
aac10c
+#endif
aac10c
+
aac10c
+TYPE arr1[10] = {0};
aac10c
+TYPE arr2[10] = {0};
aac10c
+TYPE *p1 = &arr1[0];
aac10c
+TYPE *p2 = &arr2[1];
aac10c
+size_t count = 9;
aac10c
+main ()
aac10c
+{
aac10c
+  MEMCPY (p1, p2, count);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/mempcpy.c b/testsuite/memstomp.nooverlap/mempcpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/mempcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/mempcpy.c	2013-03-11 13:54:25.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY mempcpy
aac10c
+#define TYPE char
aac10c
+#include "memcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/stpcpy.c b/testsuite/memstomp.nooverlap/stpcpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/stpcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/stpcpy.c	2013-03-11 13:38:53.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRCPY stpcpy
aac10c
+#include "strcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/stpncpy.c b/testsuite/memstomp.nooverlap/stpncpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/stpncpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/stpncpy.c	2013-03-11 13:38:53.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRNCPY stpncpy
aac10c
+#include "strncpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/strcat.c b/testsuite/memstomp.nooverlap/strcat.c
aac10c
--- a/testsuite/memstomp.nooverlap/strcat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/strcat.c	2013-03-11 13:38:53.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRCPY strcat
aac10c
+#include "strcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/strcpy.c b/testsuite/memstomp.nooverlap/strcpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/strcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/strcpy.c	2013-03-11 14:01:12.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef STRCPY
aac10c
+#define STRCPY strcpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+char arr1[32] = "this is a test";
aac10c
+char arr2[32] = "this is a test";
aac10c
+char *p1 = &arr1[0];
aac10c
+char *p2 = &arr2[1];
aac10c
+main ()
aac10c
+{
aac10c
+  STRCPY (p2, p1);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/strncat.c b/testsuite/memstomp.nooverlap/strncat.c
aac10c
--- a/testsuite/memstomp.nooverlap/strncat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/strncat.c	2013-03-11 13:38:53.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRNCPY strncat
aac10c
+#include "strncpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/strncpy.c b/testsuite/memstomp.nooverlap/strncpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/strncpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/strncpy.c	2013-03-11 14:00:47.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef STRNCPY
aac10c
+#define STRNCPY strncpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+char arr1[32] = "this is a test";
aac10c
+char arr2[32] = "this is a test";
aac10c
+char *p1 = &arr1[0];
aac10c
+char *p2 = &arr2[1];
aac10c
+main ()
aac10c
+{
aac10c
+  STRNCPY (p1, p2, strlen (p2));
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/wcscat.c b/testsuite/memstomp.nooverlap/wcscat.c
aac10c
--- a/testsuite/memstomp.nooverlap/wcscat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/wcscat.c	2013-03-11 13:38:53.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define WCSCPY wcscat
aac10c
+#include "wcscpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/wcscpy.c b/testsuite/memstomp.nooverlap/wcscpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/wcscpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/wcscpy.c	2013-03-11 14:01:22.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef WCSCPY
aac10c
+#define WCSCPY wcscpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+wchar_t arr1[32] = L"this is a test";
aac10c
+wchar_t arr2[32] = L"this is a test";
aac10c
+wchar_t *p1 = &arr1[0];
aac10c
+wchar_t *p2 = &arr2[1];
aac10c
+main ()
aac10c
+{
aac10c
+  WCSCPY (p1, p2);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/wcsncat.c b/testsuite/memstomp.nooverlap/wcsncat.c
aac10c
--- a/testsuite/memstomp.nooverlap/wcsncat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/wcsncat.c	2013-03-11 13:38:53.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define WCSNCPY wcsncat
aac10c
+#include "wcsncpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/wcsncpy.c b/testsuite/memstomp.nooverlap/wcsncpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/wcsncpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/wcsncpy.c	2013-03-11 14:01:26.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef WCSNCPY
aac10c
+#define WCSNCPY wcsncpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+wchar_t arr1[32] = L"this is a test";
aac10c
+wchar_t arr2[32] = L"this is a test";
aac10c
+wchar_t *p1 = &arr1[0];
aac10c
+wchar_t *p2 = &arr2[1];
aac10c
+main ()
aac10c
+{
aac10c
+  WCSNCPY (p1, p2, wcslen (p2));
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/wmemcpy.c b/testsuite/memstomp.nooverlap/wmemcpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/wmemcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/wmemcpy.c	2013-03-11 13:54:32.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY wmemcpy
aac10c
+#define TYPE wchar_t
aac10c
+#include "memcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.nooverlap/wmempcpy.c b/testsuite/memstomp.nooverlap/wmempcpy.c
aac10c
--- a/testsuite/memstomp.nooverlap/wmempcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/wmempcpy.c	2013-03-11 13:54:38.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY wmempcpy
aac10c
+#define TYPE wchar_t
aac10c
+#include "memcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/memccpy-2.c b/testsuite/memstomp.overlap/memccpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/memccpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/memccpy-2.c	2013-03-11 14:12:34.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef MEMCCPY
aac10c
+#define MEMCCPY memccpy
aac10c
+#define TYPE char
aac10c
+#endif
aac10c
+
aac10c
+TYPE arr[10] = {0};
aac10c
+TYPE *p1 = &arr[0];
aac10c
+TYPE *p2 = &arr[1];
aac10c
+size_t count = 9;
aac10c
+main ()
aac10c
+{
aac10c
+  MEMCCPY (p2, p1, -1, count);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/memccpy.c b/testsuite/memstomp.overlap/memccpy.c
aac10c
--- a/testsuite/memstomp.overlap/memccpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/memccpy.c	2013-03-11 14:12:41.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef MEMCCPY
aac10c
+#define MEMCCPY memccpy
aac10c
+#define TYPE char
aac10c
+#endif
aac10c
+
aac10c
+TYPE arr[10] = {0};
aac10c
+TYPE *p1 = &arr[0];
aac10c
+TYPE *p2 = &arr[1];
aac10c
+size_t count = 9;
aac10c
+main ()
aac10c
+{
aac10c
+  MEMCCPY (p1, p2, -1, count);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/memcpy-2.c b/testsuite/memstomp.overlap/memcpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/memcpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/memcpy-2.c	2013-03-11 14:12:26.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef MEMCPY
aac10c
+#define MEMCPY memcpy
aac10c
+#define TYPE char
aac10c
+#endif
aac10c
+
aac10c
+TYPE arr[10] = {0};
aac10c
+TYPE *p1 = &arr[0];
aac10c
+TYPE *p2 = &arr[1];
aac10c
+size_t count = 9;
aac10c
+main ()
aac10c
+{
aac10c
+  MEMCPY (p2, p1, count);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/memcpy.c b/testsuite/memstomp.overlap/memcpy.c
aac10c
--- a/testsuite/memstomp.overlap/memcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/memcpy.c	2013-03-11 14:12:20.000000000 -0600
aac10c
@@ -0,0 +1,19 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef MEMCPY
aac10c
+#define MEMCPY memcpy
aac10c
+#define TYPE char
aac10c
+#endif
aac10c
+
aac10c
+TYPE arr[10] = {0};
aac10c
+TYPE *p1 = &arr[0];
aac10c
+TYPE *p2 = &arr[1];
aac10c
+size_t count = 9;
aac10c
+main ()
aac10c
+{
aac10c
+  MEMCPY (p1, p2, count);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/mempcpy-2.c b/testsuite/memstomp.overlap/mempcpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/mempcpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/mempcpy-2.c	2013-03-11 13:52:51.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY mempcpy
aac10c
+#define TYPE char
aac10c
+#include "memcpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/mempcpy.c b/testsuite/memstomp.overlap/mempcpy.c
aac10c
--- a/testsuite/memstomp.overlap/mempcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/mempcpy.c	2013-03-11 13:53:10.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY mempcpy
aac10c
+#define TYPE char
aac10c
+#include "memcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/stpcpy-2.c b/testsuite/memstomp.overlap/stpcpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/stpcpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/stpcpy-2.c	2013-03-11 13:26:50.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRCPY stpcpy
aac10c
+#include "strcpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/stpcpy.c b/testsuite/memstomp.overlap/stpcpy.c
aac10c
--- a/testsuite/memstomp.overlap/stpcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/stpcpy.c	2013-03-05 15:36:43.000000000 -0700
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRCPY stpcpy
aac10c
+#include "strcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/stpncpy-2.c b/testsuite/memstomp.overlap/stpncpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/stpncpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/stpncpy-2.c	2013-03-11 13:27:02.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRNCPY stpncpy
aac10c
+#include "strncpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/stpncpy.c b/testsuite/memstomp.overlap/stpncpy.c
aac10c
--- a/testsuite/memstomp.overlap/stpncpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/stpncpy.c	2013-03-05 15:37:22.000000000 -0700
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRNCPY stpncpy
aac10c
+#include "strncpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strcat-2.c b/testsuite/memstomp.overlap/strcat-2.c
aac10c
--- a/testsuite/memstomp.overlap/strcat-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strcat-2.c	2013-03-11 13:27:10.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRCPY strcat
aac10c
+#include "strcpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strcat.c b/testsuite/memstomp.overlap/strcat.c
aac10c
--- a/testsuite/memstomp.overlap/strcat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strcat.c	2013-03-05 15:38:38.000000000 -0700
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRCPY strcat
aac10c
+#include "strcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strcpy-2.c b/testsuite/memstomp.overlap/strcpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/strcpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strcpy-2.c	2013-03-11 14:01:54.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef STRCPY
aac10c
+#define STRCPY strcpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+char arr[32] = "this is a test";
aac10c
+char *p1 = &arr[0];
aac10c
+char *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  STRCPY (p1, p2);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strcpy.c b/testsuite/memstomp.overlap/strcpy.c
aac10c
--- a/testsuite/memstomp.overlap/strcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strcpy.c	2013-03-11 14:01:58.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef STRCPY
aac10c
+#define STRCPY strcpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+char arr[32] = "this is a test";
aac10c
+char *p1 = &arr[0];
aac10c
+char *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  STRCPY (p2, p1);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strncat-2.c b/testsuite/memstomp.overlap/strncat-2.c
aac10c
--- a/testsuite/memstomp.overlap/strncat-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strncat-2.c	2013-03-11 13:27:47.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRNCPY strncat
aac10c
+#include "strncpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strncat.c b/testsuite/memstomp.overlap/strncat.c
aac10c
--- a/testsuite/memstomp.overlap/strncat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strncat.c	2013-03-05 15:38:56.000000000 -0700
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define STRNCPY strncat
aac10c
+#include "strncpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strncpy-2.c b/testsuite/memstomp.overlap/strncpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/strncpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strncpy-2.c	2013-03-11 14:02:00.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef STRNCPY
aac10c
+#define STRNCPY strncpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+char arr[32] = "this is a test";
aac10c
+char *p1 = &arr[0];
aac10c
+char *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  STRNCPY (p2, p1, strlen (p1));
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/strncpy.c b/testsuite/memstomp.overlap/strncpy.c
aac10c
--- a/testsuite/memstomp.overlap/strncpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/strncpy.c	2013-03-11 14:02:40.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef STRNCPY
aac10c
+#define STRNCPY strncpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+char arr[32] = "this is a test";
aac10c
+char *p1 = &arr[0];
aac10c
+char *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  STRNCPY (p1, p2, strlen (p2));
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcscat-2.c b/testsuite/memstomp.overlap/wcscat-2.c
aac10c
--- a/testsuite/memstomp.overlap/wcscat-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcscat-2.c	2013-03-11 13:34:04.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define WCSCPY wcscat
aac10c
+#include "wcscpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcscat.c b/testsuite/memstomp.overlap/wcscat.c
aac10c
--- a/testsuite/memstomp.overlap/wcscat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcscat.c	2013-03-11 13:33:44.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define WCSCPY wcscat
aac10c
+#include "wcscpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcscpy-2.c b/testsuite/memstomp.overlap/wcscpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/wcscpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcscpy-2.c	2013-03-11 14:02:06.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef WCSCPY
aac10c
+#define WCSCPY wcscpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+wchar_t arr[32] = L"this is a test";
aac10c
+wchar_t *p1 = &arr[0];
aac10c
+wchar_t *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  WCSCPY (p2, p1);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcscpy.c b/testsuite/memstomp.overlap/wcscpy.c
aac10c
--- a/testsuite/memstomp.overlap/wcscpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcscpy.c	2013-03-11 14:02:10.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef WCSCPY
aac10c
+#define WCSCPY wcscpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+wchar_t arr[32] = L"this is a test";
aac10c
+wchar_t *p1 = &arr[0];
aac10c
+wchar_t *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  WCSCPY (p1, p2);
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcsncat.c b/testsuite/memstomp.overlap/wcsncat.c
aac10c
--- a/testsuite/memstomp.overlap/wcsncat.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcsncat.c	2013-03-11 13:34:37.000000000 -0600
aac10c
@@ -0,0 +1,2 @@
aac10c
+#define WCSNCPY wcsncat
aac10c
+#include "wcsncpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcsncpy-2.c b/testsuite/memstomp.overlap/wcsncpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/wcsncpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcsncpy-2.c	2013-03-11 14:02:13.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef WCSNCPY
aac10c
+#define WCSNCPY wcsncpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+wchar_t arr[32] = L"this is a test";
aac10c
+wchar_t *p1 = &arr[0];
aac10c
+wchar_t *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  WCSNCPY (p2, p1, wcslen (p2));
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wcsncpy.c b/testsuite/memstomp.overlap/wcsncpy.c
aac10c
--- a/testsuite/memstomp.overlap/wcsncpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wcsncpy.c	2013-03-11 14:02:19.000000000 -0600
aac10c
@@ -0,0 +1,18 @@
aac10c
+#define _GNU_SOURCE
aac10c
+#include <string.h>
aac10c
+#include <wchar.h>
aac10c
+
aac10c
+#ifndef WCSNCPY
aac10c
+#define WCSNCPY wcsncpy
aac10c
+#endif
aac10c
+
aac10c
+
aac10c
+wchar_t arr[32] = L"this is a test";
aac10c
+wchar_t *p1 = &arr[0];
aac10c
+wchar_t *p2 = &arr[1];
aac10c
+main ()
aac10c
+{
aac10c
+  WCSNCPY (p1, p2, wcslen (p2));
aac10c
+}
aac10c
+
aac10c
+
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wmemcpy-2.c b/testsuite/memstomp.overlap/wmemcpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/wmemcpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wmemcpy-2.c	2013-03-11 13:53:21.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY wmemcpy
aac10c
+#define TYPE wchar_t
aac10c
+#include "memcpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wmemcpy.c b/testsuite/memstomp.overlap/wmemcpy.c
aac10c
--- a/testsuite/memstomp.overlap/wmemcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wmemcpy.c	2013-03-11 13:51:10.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY wmemcpy
aac10c
+#define TYPE wchar_t
aac10c
+#include "memcpy.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wmempcpy-2.c b/testsuite/memstomp.overlap/wmempcpy-2.c
aac10c
--- a/testsuite/memstomp.overlap/wmempcpy-2.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wmempcpy-2.c	2013-03-11 13:53:32.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY wmempcpy
aac10c
+#define TYPE wchar_t
aac10c
+#include "memcpy-2.c"
aac10c
diff -Nrup a/testsuite/memstomp.overlap/wmempcpy.c b/testsuite/memstomp.overlap/wmempcpy.c
aac10c
--- a/testsuite/memstomp.overlap/wmempcpy.c	1969-12-31 17:00:00.000000000 -0700
aac10c
+++ b/testsuite/memstomp.overlap/wmempcpy.c	2013-03-11 13:51:14.000000000 -0600
aac10c
@@ -0,0 +1,3 @@
aac10c
+#define MEMCPY wmempcpy
aac10c
+#define TYPE wchar_t
aac10c
+#include "memcpy.c"
aac10c
--- /dev/null	2013-02-26 15:11:24.372721019 -0700
aac10c
+++ b/testsuite/lib/memstomp.exp	2013-03-11 21:37:45.680005590 -0600
aac10c
@@ -0,0 +1,15 @@
aac10c
+proc find_memstomp {} {
aac10c
+  global tool_root_dir 
aac10c
+  global base_dir
aac10c
+
aac10c
+  set file [findfile $base_dir/../memstomp $base_dir/../memstomp memstomp]
aac10c
+  return $file
aac10c
+}
aac10c
+
aac10c
+proc find_libmemstomp {} {
aac10c
+  global tool_root_dir 
aac10c
+  global base_dir
aac10c
+
aac10c
+  set file [findfile $base_dir/../.libs/libmemstomp.so $base_dir/../.libs/libmemstomp.so libmemstomp.so]
aac10c
+  return $file
aac10c
+}
aac10c
--- /dev/null	2013-02-26 15:11:24.372721019 -0700
aac10c
+++ b/testsuite/memstomp.overlap/overlap.exp	2013-03-11 21:38:02.207939417 -0600
aac10c
@@ -0,0 +1,59 @@
aac10c
+# Copyright (C) 2013 Free Software Foundation, Inc.
aac10c
+
aac10c
+# This program is free software; you can redistribute it and/or modify
aac10c
+# it under the terms of the GNU General Public License as published by
aac10c
+# the Free Software Foundation; either version 3 of the License, or
aac10c
+# (at your option) any later version.
aac10c
+#
aac10c
+# This program is distributed in the hope that it will be useful,
aac10c
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
aac10c
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
aac10c
+# GNU General Public License for more details.
aac10c
+#
aac10c
+# You should have received a copy of the GNU General Public License
aac10c
+# along with GCC; see the file COPYING3.  If not see
aac10c
+# <http://www.gnu.org/licenses/>.
aac10c
+#
aac10c
+# This was originally copied from GCC's dejagnu testing framework
aac10c
+#
aac10c
+
aac10c
+load_lib memstomp.exp
aac10c
+set memstomp [find_memstomp]
aac10c
+set libmemstomp [find_libmemstomp]
aac10c
+
aac10c
+if $tracelevel then {
aac10c
+    strace $tracelevel
aac10c
+}
aac10c
+
aac10c
+#
aac10c
+# main test loop
aac10c
+#
aac10c
+
aac10c
+proc compile-and-execute { sources } {
aac10c
+  global memstomp
aac10c
+  global libmemstomp
aac10c
+
aac10c
+  set src [lindex $sources 0]
aac10c
+
aac10c
+  if {[catch {exec gcc -fno-builtin $src} results]} {
aac10c
+    fail "$src compilation $results"
aac10c
+  } else {
aac10c
+    pass "$src compilation $results"
aac10c
+  }
aac10c
+
aac10c
+  catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp $memstomp ./a.out"} results
aac10c
+  if {[regexp "overlap for a.out" $results]} {
aac10c
+    pass "$src found overlap $results"
aac10c
+  } else {
aac10c
+    fail "$src found overlap $results"
aac10c
+  }
aac10c
+}
aac10c
+
aac10c
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
aac10c
+    # If we're only testing specific files and this isn't one of them, skip it.
aac10c
+    if ![runtest_file_p $runtests $src] then {
aac10c
+        continue
aac10c
+    }
aac10c
+
aac10c
+   compile-and-execute $src
aac10c
+}
aac10c
--- /dev/null	2013-02-26 15:11:24.372721019 -0700
aac10c
+++ b/testsuite/memstomp.nooverlap/nooverlap.exp	2013-03-11 21:39:20.352626597 -0600
aac10c
@@ -0,0 +1,55 @@
aac10c
+# Copyright (C) 2013 Free Software Foundation, Inc.
aac10c
+
aac10c
+# This program is free software; you can redistribute it and/or modify
aac10c
+# it under the terms of the GNU General Public License as published by
aac10c
+# the Free Software Foundation; either version 3 of the License, or
aac10c
+# (at your option) any later version.
aac10c
+#
aac10c
+# This program is distributed in the hope that it will be useful,
aac10c
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
aac10c
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
aac10c
+# GNU General Public License for more details.
aac10c
+#
aac10c
+# You should have received a copy of the GNU General Public License
aac10c
+# along with GCC; see the file COPYING3.  If not see
aac10c
+# <http://www.gnu.org/licenses/>.
aac10c
+#
aac10c
+# This was originally copied from GCC's dejagnu testing framework
aac10c
+# 
aac10c
+load_lib memstomp.exp
aac10c
+set memstomp [find_memstomp]
aac10c
+set libmemstomp [find_libmemstomp]
aac10c
+
aac10c
+if $tracelevel then {
aac10c
+    strace $tracelevel
aac10c
+}
aac10c
+
aac10c
+#
aac10c
+# main test loop
aac10c
+#
aac10c
+
aac10c
+proc compile-and-execute { sources } {
aac10c
+  global memstomp
aac10c
+  set src [lindex $sources 0]
aac10c
+
aac10c
+  if {[catch {exec gcc -fno-builtin $src} results]} {
aac10c
+    fail "$src compilation $results"
aac10c
+  } else {
aac10c
+    pass "$src compilation $results"
aac10c
+  }
aac10c
+  catch {exec /bin/bash -c "LD_PRELOAD=$libmemstomp $memstomp ./a.out"} results
aac10c
+  if {[regexp "overlap for a.out" $results]} {
aac10c
+    fail "$src found no overlap $results"
aac10c
+  } else {
aac10c
+    pass "$src found no overlap $results"
aac10c
+  }
aac10c
+}
aac10c
+
aac10c
+foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.c]] {
aac10c
+    # If we're only testing specific files and this isn't one of them, skip it.
aac10c
+    if ![runtest_file_p $runtests $src] then {
aac10c
+        continue
aac10c
+    }
aac10c
+
aac10c
+   compile-and-execute $src
aac10c
+}