#!/bin/sh -e
# SPDX-FileCopyrightText: 2021 John Scott <jscott@posteo.net>
# SPDX-License-Identifier: GPL-3.0-or-later
# Compute the number of primes that can fit in an int16_t

sh-elf-gcc debian/tests/primes.c -o "$AUTOPKGTEST_TMP"/primes
cd "$AUTOPKGTEST_TMP"
sim="$(sh-elf-run ./primes)"

if [ "$sim" != "3512" ]
then
	echo "Got '$sim' from the simulator, was expecting '3512'" >&2
	exit 1
fi
