#!/bin/sh
TESTSDIR=debian/tests
TMP=${AUTOPKGTEST_TMP:-.}

. $TESTSDIR/common

# Assemble.
umask 022
h8300-hitachi-coff-as -o $TMP/asm1.o $TESTSDIR/asm.s
check $?

# Assemble again.
umask 077
sleep 2
h8300-hitachi-coff-as -o $TMP/asm2.o $TESTSDIR/asm.s
check $?

# Compare.
compare_bin $TMP/asm1.o $TMP/asm2.o

# Archive.
umask 022
rm -f $TMP/libasm1.a
h8300-hitachi-coff-ar -src $TMP/libasm1.a $TMP/asm1.o
check $?

# Archive again.
umask 077
sleep 2
rm -f $TMP/libasm2.a
h8300-hitachi-coff-ar -src $TMP/libasm2.a $TMP/asm1.o
check $?

# Compare.
compare_bin $TMP/libasm1.a $TMP/libasm2.a

echo Success
exit 0
