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