|
From: <sv...@va...> - 2006-01-22 16:44:42
|
Author: sewardj
Date: 2006-01-22 16:44:35 +0000 (Sun, 22 Jan 2006)
New Revision: 5585
Log:
Use the bz2 test in perf/ as a regression-test, just as a moderately
complex integer program which exercises Vex a bit.
Added:
trunk/memcheck/tests/vcpu_bz2.c
trunk/memcheck/tests/vcpu_bz2.stderr.exp
trunk/memcheck/tests/vcpu_bz2.stdout.exp
trunk/memcheck/tests/vcpu_bz2.vgtest
Modified:
trunk/memcheck/tests/Makefile.am
trunk/perf/bz2.c
Modified: trunk/memcheck/tests/Makefile.am
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/Makefile.am 2006-01-22 15:51:49 UTC (rev 5584)
+++ trunk/memcheck/tests/Makefile.am 2006-01-22 16:44:35 UTC (rev 5585)
@@ -107,6 +107,7 @@
toobig-allocs.stderr.exp toobig-allocs.vgtest \
trivialleak.stderr.exp trivialleak.vgtest \
metadata.stderr.exp metadata.stdout.exp metadata.vgtest-HIDING \
+ vcpu_bz2.stdout.exp vcpu_bz2.stderr.exp vcpu_bz2.vgtest \
vgtest_ume.stderr.exp vgtest_ume.disabled \
wrap1.vgtest wrap1.stdout.exp wrap1.stderr.exp \
wrap2.vgtest wrap2.stdout.exp wrap2.stderr.exp \
@@ -149,6 +150,7 @@
supp_unknown supp1 supp2 suppfree \
trivialleak \
mismatches new_override metadata \
+ vcpu_bz2 \
xml1 \
wrap1 wrap2 wrap3 wrap4 wrap5 wrap6 wrap7 wrap7so.so wrap8 \
writev zeropage
@@ -165,6 +167,7 @@
oset_test_CFLAGS =3D $(AM_FLAG_M3264_PRI) \
-DVGA_$(VG_ARCH)=3D1 -DVGO_$(VG_OS)=3D1 \
-DVGP_$(VG_ARCH)_$(VG_OS)=3D1
+vcpu_bz2_CFLAGS =3D $(AM_FLAG_M3264_PRI) $(AM_CFLAGS) -O2 -g
=20
# Don't allow GCC to inline memcpy(), because then we can't intercept it
overlap_CFLAGS =3D $(AM_CFLAGS) -fno-builtin-memcpy
Added: trunk/memcheck/tests/vcpu_bz2.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/vcpu_bz2.c (rev 0)
+++ trunk/memcheck/tests/vcpu_bz2.c 2006-01-22 16:44:35 UTC (rev 5585)
@@ -0,0 +1 @@
+link ../../perf/bz2.c
\ No newline at end of file
Property changes on: trunk/memcheck/tests/vcpu_bz2.c
___________________________________________________________________
Name: svn:special
+ *
Added: trunk/memcheck/tests/vcpu_bz2.stderr.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Added: trunk/memcheck/tests/vcpu_bz2.stdout.exp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/vcpu_bz2.stdout.exp (rev=
0)
+++ trunk/memcheck/tests/vcpu_bz2.stdout.exp 2006-01-22 16:44:35 UTC (rev=
5585)
@@ -0,0 +1,70 @@
+22323 bytes read
+ block 1: crc =3D 0xA212ABF8, combined CRC =3D 0xA212ABF8, size =3D 2=
2373
+ too repetitive; using fallback sorting algorithm
+ 22373 in block, 13504 after MTF & 1-2 coding, 79+2 syms in use
+ pass 1: size is 17143, grp uses are 38 62 2 92 6 71=20
+ pass 2: size is 6506, grp uses are 28 71 0 86 9 77=20
+ pass 3: size is 6479, grp uses are 26 70 0 81 11 83=20
+ pass 4: size is 6469, grp uses are 26 69 0 74 17 85=20
+ bytes: mapping 19, selectors 66, code lengths 134, codes 6465
+ final combined CRC =3D 0xA212ABF8
+ 6710 after compression
+bit 0 -5 DATA_ERROR_MAGIC=20
+bit 1 -5 DATA_ERROR_MAGIC=20
+bit 2 -5 DATA_ERROR_MAGIC=20
+bit 3 -5 DATA_ERROR_MAGIC=20
+bit 4 -5 DATA_ERROR_MAGIC=20
+bit 5 -5 DATA_ERROR_MAGIC=20
+bit 6 -5 DATA_ERROR_MAGIC=20
+bit 7 -5 DATA_ERROR_MAGIC=20
+bit 8 -5 DATA_ERROR_MAGIC=20
+bit 9 -5 DATA_ERROR_MAGIC=20
+bit 10 -5 DATA_ERROR_MAGIC=20
+bit 11 -5 DATA_ERROR_MAGIC=20
+bit 12 -5 DATA_ERROR_MAGIC=20
+bit 13 -5 DATA_ERROR_MAGIC=20
+bit 14 -5 DATA_ERROR_MAGIC=20
+bit 15 -5 DATA_ERROR_MAGIC=20
+bit 16 -5 DATA_ERROR_MAGIC=20
+bit 17 -5 DATA_ERROR_MAGIC=20
+bit 18 -5 DATA_ERROR_MAGIC=20
+bit 19 -5 DATA_ERROR_MAGIC=20
+bit 20 -5 DATA_ERROR_MAGIC=20
+bit 21 -5 DATA_ERROR_MAGIC=20
+bit 22 -5 DATA_ERROR_MAGIC=20
+bit 23 -5 DATA_ERROR_MAGIC=20
+bit 24 0 OK really ok!
+bit 25 -5 DATA_ERROR_MAGIC=20
+bit 26 -5 DATA_ERROR_MAGIC=20
+bit 27 0 OK really ok!
+bit 28 -5 DATA_ERROR_MAGIC=20
+bit 29 -5 DATA_ERROR_MAGIC=20
+bit 30 -5 DATA_ERROR_MAGIC=20
+bit 31 -5 DATA_ERROR_MAGIC=20
+bit 32 -4 DATA_ERROR=20
+bit 33 -4 DATA_ERROR=20
+bit 34 -4 DATA_ERROR=20
+bit 35 -4 DATA_ERROR=20
+bit 2412 -4 DATA_ERROR=20
+bit 4789 -4 DATA_ERROR=20
+bit 7166 -4 DATA_ERROR=20
+bit 9543 -4 DATA_ERROR=20
+bit 11920 -4 DATA_ERROR=20
+bit 14297 -4 DATA_ERROR=20
+bit 16674 -4 DATA_ERROR=20
+bit 19051 -4 DATA_ERROR=20
+bit 21428 -4 DATA_ERROR=20
+bit 23805 -4 DATA_ERROR=20
+bit 26182 -4 DATA_ERROR=20
+bit 28559 -4 DATA_ERROR=20
+bit 30936 -4 DATA_ERROR=20
+bit 33313 -4 DATA_ERROR=20
+bit 35690 -4 DATA_ERROR=20
+bit 38067 -4 DATA_ERROR=20
+bit 40444 -4 DATA_ERROR=20
+bit 42821 -4 DATA_ERROR=20
+bit 45198 -4 DATA_ERROR=20
+bit 47575 -4 DATA_ERROR=20
+bit 49952 -4 DATA_ERROR=20
+bit 52329 -4 DATA_ERROR=20
+all ok
Added: trunk/memcheck/tests/vcpu_bz2.vgtest
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/memcheck/tests/vcpu_bz2.vgtest (rev 0)
+++ trunk/memcheck/tests/vcpu_bz2.vgtest 2006-01-22 16:44:35 UTC (rev 558=
5)
@@ -0,0 +1,3 @@
+prog: vcpu_bz2
+args: x
+vgopts: -q
Modified: trunk/perf/bz2.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- trunk/perf/bz2.c 2006-01-22 15:51:49 UTC (rev 5584)
+++ trunk/perf/bz2.c 2006-01-22 16:44:35 UTC (rev 5585)
@@ -5,6 +5,12 @@
// --profile-flags indicates that to get to the top 90%th percentile of
// dynamic BB counts requires considering the top 51 basic blocks
=20
+// This program can be used both as part of the performance test
+// suite, in which case we want it to run for quite a while,
+// and as part of the regression (correctness) test suite, in
+// which case we want it to run quickly and be verbose.
+// So it does the latter iff given a command line arg.
+
// Licensing: the code within is mostly taken from bzip2, which has a BS=
D
// license. There is a little code from Vex, which is GPL for
// non-commercial use. And it's all written by Julian Seward.
@@ -6429,13 +6435,38 @@
}
}
=20
-//void entry ( HWord(*service)(HWord,HWord) )
-int main ( void )
+static char *bzerrorstrings[] =3D {
+ "OK"
+ ,"SEQUENCE_ERROR"
+ ,"PARAM_ERROR"
+ ,"MEM_ERROR"
+ ,"DATA_ERROR"
+ ,"DATA_ERROR_MAGIC"
+ ,"IO_ERROR"
+ ,"UNEXPECTED_EOF"
+ ,"OUTBUFF_FULL"
+ ,"CONFIG_ERROR"
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+ ,"???" /* for future */
+};
+
+// If given a cmd line arg, behave as a correctness regtest
+// (run fast and be verbose). If not, run for a long time
+// which is what is needed for the performance suite.
+int main ( int argc, char** argv )
{
int r;
int bit;
int i;
=20
+ int regtest;
+ assert(argc =3D=3D 1 || argc =3D=3D 2);
+ regtest =3D argc=3D=3D2;
+
serviceFn =3D g_serviceFn;
=20
set_inbuf();
@@ -6452,16 +6483,19 @@
}
vex_printf( "%d after compression\n", nZ );
=20
- for (bit =3D 0; bit < nZ*8; bit +=3D (bit < 35 ? 1 : 137)) {
- //vex_printf( "bit %d ", bit );
+ for (bit =3D 0; bit < nZ*8; bit +=3D (bit < 35 ? 1 : (regtest?2377:13=
7))) {
+ if (regtest)
+ vex_printf( "bit %d ", bit );
flip_bit ( bit );
nOut =3D M_BLOCK_OUT;
r =3D BZ2_bzBuffToBuffDecompress (
outbuf, &nOut, zbuf, nZ, 1/*small*/, 0 );
- //vex_printf( " %d %s ", r, bzerrorstrings[-r] );
+ if (regtest)
+ vex_printf( " %d %s ", r, bzerrorstrings[-r] );
=20
if (r !=3D BZ_OK) {
- //vex_printf( "\n" );
+ if (regtest)
+ vex_printf( "\n" );
} else {
if (nOut !=3D nIn) {
vex_printf( "nIn/nOut mismatch %d %d\n", nIn, nOut );
|