#!/usr/bin/perl -w

# usage: perl test.pl <files-with-sprintf-testcases>

@ARGV = @ARGV ? @ARGV : ("spf-main.s");
for (@ARGV){
	$tempfile = "/tmp/$0.$$";
	system "cat sprintf.s $_ > $tempfile";
	@spim = `spim -file $tempfile`;
	print @spim[5,-1];
	unlink $tempfile
}
