#!/bin/sh
set -e -u
cpu=$(dpkg-architecture -q DEB_HOST_ARCH_CPU)
if [ $cpu != i386 ] && [ $cpu != amd64 ]
then
    exit 0
fi
cp 'test-instr.c' "$ADTTMP"
cd "$ADTTMP"
for CC in afl-gcc 'afl-g++ -x c++'
do
    make -B 'test-instr' CC="$CC"
	echo 0 | afl-showmap -q -o out0 ./test-instr
	echo 1 | afl-showmap -q -o out1 ./test-instr
	! diff -u out0 out1
done

# vim:ts=4 sts=4 sw=4 et
