summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <mark@klomp.org>2020-06-30 17:51:49 +0200
committerMark Wielaard <mark@klomp.org>2020-07-02 14:39:14 +0200
commit9b22e76e5a8eff7c02442879ad41529528c11623 (patch)
tree432f71f7f4d5c96772585f24e511785d79f10699
parentBugzilla 423021 - PPC: Add missing ISA 3.0 documentation link and HWCAPS test. (diff)
downloadvalgrind-auxchecks.tar.gz
valgrind-auxchecks.tar.bz2
valgrind-auxchecks.tar.xz
auxchecks gslauxchecks
-rw-r--r--Makefile.am4
-rw-r--r--auxprogs/Makefile.am99
-rw-r--r--auxprogs/gsl-1.6.out.x86.exp40
-rw-r--r--auxprogs/gsl-1.6.patch36
-rw-r--r--auxprogs/gsl-1.6.supp14
-rw-r--r--auxprogs/gsl16-badfree.patch32
-rw-r--r--auxprogs/gsl16-wavelet.patch11
-rwxr-xr-xauxprogs/gsl16test118
8 files changed, 189 insertions, 165 deletions
diff --git a/Makefile.am b/Makefile.am
index 08db834..f10517e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -94,6 +94,10 @@ exp-regtest: check
94perf: check 94perf: check
95 @PERL@ perf/vg_perf perf 95 @PERL@ perf/vg_perf perf
96 96
97# Auxiliary test suites run under valgrind
98auxchecks: all
99 $(MAKE) -C auxprogs auxchecks
100
97# Nb: no need to include any Makefile.am files here, or files included from 101# Nb: no need to include any Makefile.am files here, or files included from
98# them, as automake includes them automatically. Also not COPYING, README 102# them, as automake includes them automatically. Also not COPYING, README
99# or NEWS. 103# or NEWS.
diff --git a/auxprogs/Makefile.am b/auxprogs/Makefile.am
index 56cc5ef..83c8872 100644
--- a/auxprogs/Makefile.am
+++ b/auxprogs/Makefile.am
@@ -4,7 +4,6 @@ dist_noinst_SCRIPTS = \
4 change-copyright-year \ 4 change-copyright-year \
5 dump_insn_ppc.sh \ 5 dump_insn_ppc.sh \
6 gen-mdg \ 6 gen-mdg \
7 gsl16test \
8 gsl19test \ 7 gsl19test \
9 make_or_upd_vgversion_h \ 8 make_or_upd_vgversion_h \
10 nightly-build-summary \ 9 nightly-build-summary \
@@ -14,8 +13,9 @@ dist_noinst_SCRIPTS = \
14EXTRA_DIST = \ 13EXTRA_DIST = \
15 docs/valgrind-listener-manpage.xml \ 14 docs/valgrind-listener-manpage.xml \
16 docs/valgrind-di-server-manpage.xml \ 15 docs/valgrind-di-server-manpage.xml \
17 gsl16-badfree.patch \ 16 gsl-1.6.patch \
18 gsl16-wavelet.patch \ 17 gsl-1.6.supp \
18 gsl-1.6.out.x86.exp \
19 posixtestsuite-1.5.1-diff.txt \ 19 posixtestsuite-1.5.1-diff.txt \
20 ppcfround.c \ 20 ppcfround.c \
21 ppc64shifts.c \ 21 ppc64shifts.c \
@@ -118,12 +118,103 @@ endif
118endif 118endif
119 119
120#---------------------------------------------------------------------------- 120#----------------------------------------------------------------------------
121# Auxiliary testsuits
122#----------------------------------------------------------------------------
123
124auxchecks: gsl-check
125auxclean: gsl-clean
126
127# You can override AUX_CHECK_DIR to use a previous download/build.
128# Must be an absolute path.
129# e.g. make auxchecks AUX_CHECK_DIR=$HOME/valgrind-auxtests
130AUX_CHECK_DIR=$(abs_builddir)auxchecks
131
132# GNU Scientific Library 1.6
133GSL_DIR_NAME=gsl-1.6
134GSL_TAR_NAME=$(GSL_DIR_NAME).tar.gz
135GSL_URL=https://ftpmirror.gnu.org/gsl/$(GSL_TAR_NAME)
136GSL_SHA256_SUM=52e097b5228a617fef788d54eba6855c1addc62b8f68a1dfb5895cad25594f1f
137GSL_TAR=$(AUX_CHECK_DIR)/$(GSL_TAR_NAME)
138GSL_SRC_DIR=$(AUX_CHECK_DIR)/$(GSL_DIR_NAME)
139# By default we like -O3 to hopefully get some loop vectorization
140# You can also override GSL_CFLAGS if you want e.g. -march=core-avx2
141# Different GSL_CFLAGS will result in different build dirs (under AUX_CHECK_DIR)
142GSL_CFLAGS=-g -O3
143# i386 needs sse to get rounding for floating point correct.
144# But we only want this if the primary isn't AMD64
145if VGCONF_ARCHS_INCLUDE_X86
146if !VGCONF_ARCHS_INCLUDE_AMD64
147GSL_CFLAGS+=-mfpmath=sse -msse2
148endif
149endif
150
151# Trick to get a literal space to use in substitutions
152sp := $(subst ,, )
153
154# Filter out spaces from GSL_CFLAGS to get unique build dir
155GSL_BUILD_DIR=$(AUX_CHECK_DIR)/gsl-build$(subst $(sp),,$(GSL_CFLAGS))
156
157# These are all the tests, except siman and randist which can take minutes.
158GSL_TESTS=block cblas cdf cheb combination complex const deriv dht diff \
159 eigen err fft fit histogram ieee-utils integration interpolation \
160 linalg matrix min monte multifit multimin multiroots ntuple \
161 ode-initval permutation poly qrng rng roots sort specfunc \
162 statistics sum sys vector wavelet
163
164# Get the tar file if we don't have it yet.
165$(GSL_TAR):
166 mkdir -p $(AUX_CHECK_DIR)
167 wget -q -O $(GSL_TAR) $(GSL_URL)
168
169# We need to autoreconf to make sure to get config.guess, config.sub
170# and libtool for newer architectures.
171$(GSL_SRC_DIR)/gsl-patched: $(GSL_TAR)
172 echo "$(GSL_SHA256_SUM) $(GSL_TAR)" | sha256sum --check -
173 (cd $(AUX_CHECK_DIR) && \
174 tar zxf $(GSL_TAR_NAME) && \
175 cd $(GSL_DIR_NAME) && \
176 patch -p1 < $(abs_top_srcdir)/auxprogs/gsl-1.6.patch && \
177 autoreconf -f -i -Wnone)
178 touch $@
179
180# We need make check -k because
181# some tests might fail even native (only on i386 though).
182# make check doesn't work reliably with -j.
183$(GSL_BUILD_DIR)/gsl-build: $(GSL_SRC_DIR)/gsl-patched
184 mkdir -p $(GSL_BUILD_DIR)
185 (cd $(GSL_BUILD_DIR) && \
186 $(GSL_SRC_DIR)/configure CFLAGS="$(GSL_CFLAGS)" && \
187 make -j $(nproc) && \
188 make check -k || true)
189 touch $@
190
191# We hope all tests PASS (so don't produce output except for the test names).
192# But on x86 we get one FAIL, so that is "fine" too.
193# We currently don't check stderr, but we probably should.
194gsl-check: $(GSL_BUILD_DIR)/gsl-build
195 (cd $(GSL_BUILD_DIR); \
196 for gsl_test in $(GSL_TESTS); do \
197 echo $$gsl_test; \
198 ./libtool --mode=execute $(abs_top_builddir)/vg-in-place -q \
199 --suppressions=$(abs_top_srcdir)/auxprogs/gsl-1.6.supp \
200 $$gsl_test/test; \
201 done | grep --line-buffered -v ^PASS: | tee valgrind-gsl.out)
202 for gsl_test in $(GSL_TESTS); do echo $$gsl_test; done \
203 | cmp - $(GSL_BUILD_DIR)/valgrind-gsl.out || \
204 diff -u $(abs_top_srcdir)/auxprogs/gsl-1.6.out.x86.exp \
205 $(GSL_BUILD_DIR)/valgrind-gsl.out
206
207# We keep the tarball but remove the unpacked sources and build
208gsl-clean:
209 rm -rf $(GSL_SRC_NAME) $(GSL_BUILD_DIR)
210
211#----------------------------------------------------------------------------
121# General stuff 212# General stuff
122#---------------------------------------------------------------------------- 213#----------------------------------------------------------------------------
123 214
124all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS 215all-local: inplace-noinst_PROGRAMS inplace-noinst_DSYMS
125 216
126clean-local: clean-noinst_DSYMS 217clean-local: clean-noinst_DSYMS auxclean
127 218
128install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS 219install-exec-local: install-noinst_PROGRAMS install-noinst_DSYMS
129 220
diff --git a/auxprogs/gsl-1.6.out.x86.exp b/auxprogs/gsl-1.6.out.x86.exp
new file mode 100644
index 0000000..996f285
--- /dev/null
+++ b/auxprogs/gsl-1.6.out.x86.exp
@@ -0,0 +1,40 @@
1block
2cblas
3cdf
4cheb
5combination
6complex
7const
8deriv
9dht
10diff
11eigen
12err
13fft
14fit
15histogram
16ieee-utils
17integration
18FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected)
19interpolation
20linalg
21matrix
22min
23monte
24multifit
25multimin
26multiroots
27ntuple
28ode-initval
29permutation
30poly
31qrng
32rng
33roots
34sort
35specfunc
36statistics
37sum
38sys
39vector
40wavelet
diff --git a/auxprogs/gsl-1.6.patch b/auxprogs/gsl-1.6.patch
new file mode 100644
index 0000000..a9ffd13
--- /dev/null
+++ b/auxprogs/gsl-1.6.patch
@@ -0,0 +1,36 @@
1diff -r -u gsl-1.6/vector/test_complex_source.c gsl-1.6-patched/vector/test_complex_source.c
2--- gsl-1.6/vector/test_complex_source.c 2004-09-13 15:23:20.000000000 +0200
3+++ gsl-1.6-patched/vector/test_complex_source.c 2005-07-24 08:37:54.000000000 +0200
4@@ -75,7 +75,7 @@
5 if (stride == 1)
6 {
7 v0 = FUNCTION (gsl_vector, alloc) (N);
8- view = FUNCTION (gsl_vector, subvector) (v, 0, N);
9+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
10 v = &view.vector;
11 }
12 else
13diff -r -u gsl-1.6/vector/test_source.c gsl-1.6-patched/vector/test_source.c
14--- gsl-1.6/vector/test_source.c 2004-09-13 15:23:20.000000000 +0200
15+++ gsl-1.6-patched/vector/test_source.c 2005-07-24 08:37:54.000000000 +0200
16@@ -75,7 +75,7 @@
17 if (stride == 1)
18 {
19 v0 = FUNCTION (gsl_vector, alloc) (N);
20- view = FUNCTION (gsl_vector, subvector) (v, 0, N);
21+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
22 v = &view.vector;
23 }
24 else
25diff -r -u gsl-1.6/wavelet/dwt.c gsl-1.6-patched/wavelet/dwt.c
26--- gsl-1.6/wavelet/dwt.c 2004-12-24 14:57:34.000000000 +0100
27+++ gsl-1.6-patched/wavelet/dwt.c 2005-07-24 08:38:05.000000000 +0200
28@@ -30,7 +30,7 @@
29
30 static int binary_logn (const size_t n);
31 static void dwt_step (const gsl_wavelet * w, double *a, size_t stride,
32- size_t n, int isign, gsl_wavelet_workspace * work);
33+ size_t n, gsl_wavelet_direction dir, gsl_wavelet_workspace * work);
34
35 static int
36 binary_logn (const size_t n)
diff --git a/auxprogs/gsl-1.6.supp b/auxprogs/gsl-1.6.supp
new file mode 100644
index 0000000..addf5d8
--- /dev/null
+++ b/auxprogs/gsl-1.6.supp
@@ -0,0 +1,14 @@
1{
2 gsl-writes-uninit-data
3 Memcheck:Param
4 write(buf)
5 fun:write
6}
7
8{
9 gsl-writes-uninit-data-nocancel
10 Memcheck:Param
11 write(buf)
12 fun:__write_nocancel
13}
14
diff --git a/auxprogs/gsl16-badfree.patch b/auxprogs/gsl16-badfree.patch
deleted file mode 100644
index d07d3a1..0000000
--- a/auxprogs/gsl16-badfree.patch
+++ /dev/null
@@ -1,32 +0,0 @@
1Index: test_complex_source.c
2===================================================================
3RCS file: /home/gsl-cvs/gsl/vector/test_complex_source.c,v
4retrieving revision 1.23
5diff -u -r1.23 test_complex_source.c
6--- test_complex_source.c 24 Jun 2005 11:33:25 -0000 1.23
7+++ test_complex_source.c 6 Jul 2005 11:18:33 -0000
8@@ -75,7 +75,7 @@
9 if (stride == 1)
10 {
11 v0 = FUNCTION (gsl_vector, alloc) (N);
12- view = FUNCTION (gsl_vector, subvector) (v, 0, N);
13+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
14 v = &view.vector;
15 }
16 else
17Index: test_source.c
18===================================================================
19RCS file: /home/gsl-cvs/gsl/vector/test_source.c,v
20retrieving revision 1.26
21diff -u -r1.26 test_source.c
22--- test_source.c 24 Jun 2005 11:33:26 -0000 1.26
23+++ test_source.c 6 Jul 2005 11:14:18 -0000
24@@ -75,7 +75,7 @@
25 if (stride == 1)
26 {
27 v0 = FUNCTION (gsl_vector, alloc) (N);
28- view = FUNCTION (gsl_vector, subvector) (v, 0, N);
29+ view = FUNCTION (gsl_vector, subvector) (v0, 0, N);
30 v = &view.vector;
31 }
32 else
diff --git a/auxprogs/gsl16-wavelet.patch b/auxprogs/gsl16-wavelet.patch
deleted file mode 100644
index 525e9cf..0000000
--- a/auxprogs/gsl16-wavelet.patch
+++ /dev/null
@@ -1,11 +0,0 @@
1--- wavelet/dwt.c~ 2004-12-24 14:57:34.000000000 +0100
2+++ wavelet/dwt.c 2005-07-08 23:31:32.000000000 +0200
3@@ -30,7 +30,7 @@
4
5 static int binary_logn (const size_t n);
6 static void dwt_step (const gsl_wavelet * w, double *a, size_t stride,
7- size_t n, int isign, gsl_wavelet_workspace * work);
8+ size_t n, gsl_wavelet_direction dir, gsl_wavelet_workspace * work);
9
10 static int
11 binary_logn (const size_t n)
diff --git a/auxprogs/gsl16test b/auxprogs/gsl16test
deleted file mode 100755
index 22f7cab..0000000
--- a/auxprogs/gsl16test
+++ /dev/null
@@ -1,118 +0,0 @@
1#!/bin/sh
2
3# Do an automated test which involves building and regtesting version
4# 1.6 of the GNU Scientific Library (gsl). This has proven to be a
5# very thorough test of Vex's CPU simulations and has exposed bugs
6# which had not been previously discovered. Gsl contains more
7# than 100,000 tests as part of its regression suite, and so this
8# script's purpose is to runs those tests using valgrind and compare
9# against the same tests run natively.
10#
11# You can download gsl and get more info about it at
12# http://www.gnu.org/software/gsl
13
14
15
16# Args:
17# absolute name of gsl-1.6.tar.gz file
18# name of C compiler
19# args for C compiler
20# name of Valgrind
21# args for Valgrind
22
23# Results: 3.7.0 --tool=none
24# x86 1 failure Ubuntu 10.10
25# FAIL: qawo(f456) elist (7.25063790881233303e-15 observed vs 7.25922435194575979e-15 expected)
26# same failure was also present in 3.6.1
27# s390x 0 failures on z900 running RHEL4
28
29if [ $# != 5 ]
30then
31 echo "usage: gsl16test /absolute/name/of/gsl-1.6-patched.tar.gz"
32 echo " C-compiler-command"
33 echo " flags-for-C-compiler"
34 echo " Valgrind-command"
35 echo " flags-for-Valgrind"
36 exit 1
37fi
38
39
40runcmd () {
41 echo -n " $1 ... "
42 shift
43
44 (eval "$*") >> log.verbose 2>&1
45
46 if [ $? = 0 ]
47 then
48 echo "done"
49 return 0
50 else
51 echo "failed"
52 return 1
53 fi
54}
55
56GSL_FILE=$1
57GSL_CC=$2
58GSL_CFLAGS=$3
59GSL_VV=$4
60GSL_VFLAGS=$5
61
62TESTS1="block/test cblas/test cdf/test cheb/test combination/test"
63TESTS2="complex/test const/test deriv/test dht/test diff/test"
64TESTS3="eigen/test err/test fft/test fit/test histogram/test"
65TESTS4="ieee-utils/test integration/test interpolation/test linalg/test"
66TESTS5="matrix/test min/test monte/test multifit/test multimin/test"
67TESTS6="multiroots/test ntuple/test ode-initval/test permutation/test"
68TESTS7="poly/test qrng/test randist/test rng/test roots/test siman/test"
69TESTS8="sort/test specfunc/test statistics/test sum/test sys/test"
70TESTS9="vector/test wavelet/test"
71
72ALL_TESTS="$TESTS1 $TESTS2 $TESTS3 $TESTS4 $TESTS5 $TESTS6 $TESTS7 $TESTS8 $TESTS9"
73
74echo "gsl16test: src: " $GSL_FILE
75echo "gsl16test: cc: " $GSL_CC
76echo "gsl16test: cflags: " $GSL_CFLAGS
77echo "gsl16test: valgrind: " $GSL_VV
78echo "gsl16test: vflags: " $GSL_VFLAGS
79
80rm -rf log.verbose gsl-1.6-patched summary.txt
81
82echo > log.verbose
83
84echo > summary.txt
85echo $0 $1 \"$2\" \"$3\" \"$4\" \"$5\" >> summary.txt
86echo >> summary.txt
87
88runcmd "Untarring " \
89 "rm -rf gsl-1.6-patched && tar xzf $GSL_FILE" && \
90\
91runcmd "Configuring " \
92 "(cd gsl-1.6-patched && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" ./configure)" && \
93\
94runcmd "Building " \
95 "(cd gsl-1.6-patched && make -j4 && make -k check)"
96
97echo -n " Collecting reference results "
98rm -f out-REF
99(cd gsl-1.6-patched && for f in $ALL_TESTS ; do ./$f ; done) &> out-REF
100echo " ... done"
101
102echo -n " Collecting valgrinded results "
103rm -f out-VAL
104(cd gsl-1.6-patched && for f in $ALL_TESTS ; do eval $GSL_VV -v --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-VAL
105echo " ... done"
106
107echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)
108echo -n " Native passes: " && (grep PASS: out-REF | wc -l)
109echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)
110echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)
111
112(echo -n " Native fails: " && (grep FAIL: out-REF | wc -l)) >> summary.txt
113(echo -n " Native passes: " && (grep PASS: out-REF | wc -l)) >> summary.txt
114(echo -n " Valgrind fails: " && (grep FAIL: out-VAL | wc -l)) >> summary.txt
115(echo -n " Valgrind passes: " && (grep PASS: out-VAL | wc -l)) >> summary.txt
116echo >> summary.txt
117
118echo