scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

test.sh (430B)


      1 #!/bin/sh
      2 
      3 set -e
      4 cpu=${1?}
      5 exec >>test.log
      6 exec 2>&1
      7 
      8 tmp1=`mktemp`
      9 tmp2=`mktemp`
     10 file=$cpu.s
     11 
     12 trap "rm -f a.out $tmp1 $tmp2; exit" 0 2 3
     13 
     14 as-$cpu $file
     15 
     16 sed -n '/^\// ! {
     17 	s%.*/%%
     18 	s%^[ 	]*%%
     19 	s%[ 	]*$%%
     20 	/^$/d
     21 	s%[ 	][ 	]*%\
     22 %g
     23 	p
     24 }' $file |
     25 nl -b a > $tmp1
     26 
     27 
     28 objdump |
     29 sed -n '/^data:/,$ {
     30 	/^data:/ ! {
     31 		s%.*:%%
     32 		s%^[ 	]*%%
     33 		s%[ 	]*$%%
     34 		/^$/d
     35 		s%[ 	][ 	]*%\
     36 %g
     37 		p
     38 	}
     39 }' |
     40 nl -b a > $tmp2
     41 
     42 echo diff
     43 diff -u $tmp1 $tmp2