#!/bin/bash

regress () {
  if [ -f "`which banner`" ] ; then
      banner $1
  elif [ -f ./banner ] ; then
      ./banner $1
  fi  
  cp regression-compile/$1.imp regression-compile-tmp/$1.imp
# ./i2c -c regression-compile-tmp/$1.imp 2> regression-compile-tmp/$1.err
  i77 -c regression-compile-tmp/$1.imp 2> regression-compile-tmp/$1.err
  #clang-format regression-compile-tmp/$1.c | ecce - - -command "((v. .r)0v.//.e-0i/ /72m,m)0;%c" 2> /dev/null > regression-compile-tmp/$1-pretty.c
  ./idec --i2c regression-compile-tmp/$1 > regression-compile-tmp/$1.idec
  diff regression-compile-tmp/$1.err regression-compile/$1.err
  diff regression-compile-tmp/$1.c regression-compile/$1.c
}

regress nrimp10s-77
regress allimpc1-77
regress imp918s
regress chimp
regress pass1
regress bigtest
regress hal7502
regress asm6809
regress skimp77
regress skimpais
regress soaps-77
regress wumpus
regress gpm
regress check
regress shiftprecbug
regress vax-pass1
regress vax-pass2
regress vax-pass3
regress compare
regress imp22g-77
regress shiftadd
regress recordmap
regress badfor
regress decode-77
regress labscope
regress testprocparam
regress syscall
regress asems412
regress comp412
regress gens400
regress hal70
regress chimps
regress EVENTS
regress nminimo
regress gammon
regress bcpls
regress casterr
regress addsuba
regress precedence-rainer
regress unwinding
regress array2d
regress badsignal
regress haunt
regress random
regress restests
regress nameparmass
regress skimpd
regress blocklab

fgrep error regression-compile-tmp/*.err # |grep -v "duplicate label"|grep -v "invalid type argument of unary"
