Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit dff562c4 authored by Léo Gourdin's avatar Léo Gourdin
Browse files

moving my tests

parent e37d655d
# Testing the Machblock --> Asmblock translation
1. Get the reference version of compcert-aarch in the father's directory if this repo (checkout `aarch64-ref`)
2. Compile both repo for aarch64
3. CD in this folder (`test/aarch64`)
4. Launch `./asmb_aarch64_gen_test.sh`
## Options
The script takes following options :
- `-c` to clear generated files at the end
- `-w` to suppress warnings from Compcert
## Tests files
The variable `DIRS` in the script takes the list of directories containing c files.
The tests under `test/aarch64/c` are simpler and useful to debug only one feature at a time.
Most of them comes from [here](https://cis.temple.edu/~ingargio/cis71/code/).
#!/bin/bash
CLEAN=0
WOFF=0
while getopts ':cw' 'OPTKEY'; do
case ${OPTKEY} in
c) CLEAN=1;;
w) WOFF=1;;
esac
done
DIRS=(
../c/*.c # Special simple tests
#../../c/*.c
../../clightgen/*.c
#../../compression/*.c
../../cse2/*.c
# Monniaux test directory
../../monniaux/binary_search/*.c
../../monniaux/complex/*.c
#../../monniaux/crypto-algorithms/*.c # Warnings
../../monniaux/cse2/*.c
#../../monniaux/des/*.c # Unsupported feature?
../../monniaux/expect/*.c
../../monniaux/fill_buffer/*.c
../../monniaux/genann/*.c
#../../monniaux/heptagon_radio_transmitter/*.c # Warnings
../../monniaux/idea/*.c
../../monniaux/jumptable/*.c
../../monniaux/licm/*.c
../../monniaux/longjmp/*.c
../../monniaux/loop/*.c
../../monniaux/lustrev4_lustrec_heater_control/*.c
../../monniaux/lustrev4_lv4_heater_control/*.c
../../monniaux/lustrev4_lv6-en-2cgc_heater_control/*.c
#../../monniaux/lustrev6-carlightV2/*.c # Warnings
#../../monniaux/lustrev6-convertible-2cgc/*.c # Unsupported feature?
#../../monniaux/lustrev6-convertible-en-2cgc/*.c
#../../monniaux/lustrev6-convertible/*.c # Warnings
../../monniaux/madd/*.c
#../../monniaux/math/*.c # Unsupported feature?
../../monniaux/memcpy/*.c
#../../monniaux/micro-bunzip/*.c # Warnings
../../monniaux/moves/*.c
../../monniaux/multithreaded_volatile/*.c
../../monniaux/nand/*.c
#../../monniaux/ncompress/*.c # Warnings
../../monniaux/number_theoretic_transform/*.c
../../monniaux/predicated/*.c
../../monniaux/regalloc/*.c
../../monniaux/rotate/*.c
../../monniaux/scheduling/*.c
../../monniaux/send_through/*.c
../../monniaux/tiny-AES-c/*.c
../../monniaux/varargs/*.c
../../monniaux/xor_and_mat/*.c
#../../monniaux/zlib-1.2.11/*.c # Warnings
)
#FILES=../c/*.c
CCOMP_BBLOCKS="../../../ccomp -fno-postpass"
CCOMP_REF="../../../../CompCert_kvx/ccomp"
COUNT=0
if [ $WOFF -eq 1 ]
then
CCOMP_BBLOCKS="${CCOMP_BBLOCKS} -w"
CCOMP_REF="${CCOMP_REF} -w"
fi
for files in ${DIRS[@]}
do
for f in $files
do
BNAME=$(basename -s .c $f)
SNAME="$BNAME".s
SREFNAME="$BNAME"_ref.s
./$CCOMP_BBLOCKS -S $f -o $SNAME
./$CCOMP_REF -dmach -S $f -o $SREFNAME
#diff -I '^//*' <(cut -c-5 $SNAME) <(cut -c-5 $SREFNAME) > /dev/null 2>&1
diff -I '^//*' $SNAME $SREFNAME > /dev/null 2>&1
error=$?
if [ $error -eq 0 ]
then
echo "[$BNAME] OK"
COUNT=$((COUNT + 1))
elif [ $error -eq 1 ]
then
echo "[$BNAME] FAIL"
diff -I '^//*' -y $SNAME $SREFNAME
exit 1
else
echo "[$BNAME] FAIL"
echo "[WARNING] There was something wrong with the diff command !"
exit 1
fi
done
done
echo "[TOTAL] $COUNT tests PASSED"
if [ $CLEAN -eq 1 ]
then
rm *.s *.mach
fi
#!/bin/bash
CLEAN=0
WOFF=0
SRC=""
while getopts ':cwi:' 'OPTKEY'; do
case ${OPTKEY} in
c) CLEAN=1;;
w) WOFF=1;;
i) SRC=${OPTARG};;
esac
done
CCOMP="../../../ccomp -static"
if [ $WOFF -eq 1 ]
then
CCOMP="${CCOMP} -w"
fi
BNAME=$(basename -s .c $SRC)
SNAME="$BNAME".s
SREFNAME="$BNAME"_ref.s
ENAME="$BNAME"
EREFNAME="$BNAME"_ref
./$CCOMP -S $SRC -o $SNAME
./$CCOMP -fno-postpass -S $SRC -o $SREFNAME
./$CCOMP $SRC -o $ENAME
./$CCOMP -fno-postpass $SRC -o $EREFNAME
#diff -I '^//*' -y $SNAME $SREFNAME
if [ $CLEAN -eq 1 ]
then
rm $SNAME $SREFNAME $ENAME $EREFNAME
fi
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment