-rwxr-xr-x 1329 djbsort-20180717/verif/verifymany
#!/bin/sh -e
version=`cat ../version`
tmp=../link-build/verify-$version
rm -rf $tmp
mkdir -p $tmp
for n in `seq 0 512`
do
for lib in ../link-install/lib-*
do
c=`cat $lib/compiler`
echo "n=$n lib=$lib compiler=$c"
echo '
#include <stdio.h>
#include "int32_sort.h"
int32_t symbolic['$n'];
int main()
{
long long i;
int32_sort(symbolic,'$n');
for (i = 0;i < '$n';++i) printf("%d\\n",symbolic[i]);
return 0;
}
' > $tmp/symbolic.c
time $c \
-L $lib -Wl,-rpath=$lib \
-I $lib/include \
-o $tmp/symbolic $tmp/symbolic.c \
-l djbsort
time ./unroll symbolic $n $tmp/symbolic > $tmp/unroll
time ./tryinput $n < $tmp/unroll > $tmp/input
time python3 $tmp/input
time ./minmax $n < $tmp/unroll > $tmp/minmax
time ./tryinput $n < $tmp/minmax > $tmp/input
time python3 $tmp/input
time ./decompose $n int32_sort_symbolic < $tmp/minmax
echo '
#include <stdio.h>
#include "int32_sort.h"
int main()
{
printf("\\n");
printf("verified '$n' %s %s %s\\n",int32_sort_implementation,int32_sort_compiler,__VERSION__);
printf("\\n");
return 0;
}
' > $tmp/verified.c
time $c \
-L $lib -Wl,-rpath=$lib \
-I $lib/include \
-o $tmp/verified $tmp/verified.c \
-l djbsort
tput bold || :
$tmp/verified
tput sgr0 || :
done
done