| | @@ -160,6 +160,21 @@ |
| 160 | 160 | if $raz -S $f 2>&1 | cmp -s $want -; then pass=$((pass + 1)) |
| 161 | 161 | else echo "FAIL raz -S $f"; $raz -S $f 2>&1 | diff $want - | head; fail=$((fail + 1)); fi |
| 162 | 162 | done |
| 163 | +# raz -S's form, as raz(1) states it: every line is blank, a procedure's |
| 164 | +# name (after a blank line), a source line (number to column 6, two spaces, |
| 165 | +# text) or an instruction (offset to column 14, two spaces, text); a jump |
| 166 | +# gives its target as a number |
| 167 | +if $raz -S test/list/Listing.raz 2>&1 | awk ' |
| 168 | + NR == 1 && $0 != "" { bad = "first line not blank" } |
| 169 | + $0 == "" { blank = 1; next } |
| 170 | + /^[A-Za-z0-9]+\.[A-Za-z0-9.]+:$/ { if (!blank) bad = "name after no blank: " $0; blank = 0; next } |
| 171 | + { blank = 0 } |
| 172 | + match($0, /^ *[0-9]+/) && (RLENGTH == 6 || RLENGTH == 14) && substr($0, RLENGTH + 1, 2) == " " { |
| 173 | + if (RLENGTH == 14 && $0 ~ /^ *[0-9]+ j[a-z]* / && $0 !~ / j[a-z]* [0-9]+$/) bad = "jump with no offset: " $0 |
| 174 | + next } |
| 175 | + { bad = "no form: " $0 } |
| 176 | + END { if (bad != "") { print bad; exit 1 } }'; then pass=$((pass + 1)) |
| 177 | +else echo "FAIL raz -S: a line not of raz(1)'s form"; fail=$((fail + 1)); fi |
| 163 | 178 | # the report's version is the one the compiler says it follows |
| 164 | 179 | # the version the compiler follows: the report's, or one it names while |
| 165 | 180 | # the compiler catches up |