scc

A fork of https://git.simple-cc.org/scc/ for Qute

git clone https://git.8pit.net/scc.git

 1#!/bin/sh
 2
 3set -e
 4cpu=${1?'missed cpu argument'}
 5exec >>test.log
 6exec 2>&1
 7
 8tmp1=tmp1.$$
 9tmp2=tmp2.$$
10file=$cpu.s
11
12trap 'rm -f a.out $tmp1 $tmp2' EXIT
13trap 'exit $?' HUP INT TERM
14
15$EXEC scc as -m $cpu $file
16
17sed -n '/^\#/ ! {
18	/\#/ ! d
19	s%.*#%%
20	s%^[ 	]*%%
21	s%[ 	]*$%%
22	/^$/d
23	s%[ 	][ 	]*%\
24%g
25	p
26}' $file |
27nl -b a > $tmp1
28
29od -An -t x1 a.out |
30tr 'a-z' 'A-Z' |
31sed -n 's%.*:%%
32	s%^[ 	]*%%
33	s%[ 	]*$%%
34	/^$/d
35	s%[ 	][ 	]*%\
36%g
37	p' |
38nl -b a > $tmp2
39
40diff -u $tmp1 $tmp2