diff --git a/scripts/m1/dis-roundtrip.sh b/scripts/m1/dis-roundtrip.sh index b2f735e..5e8822d 100755 --- a/scripts/m1/dis-roundtrip.sh +++ b/scripts/m1/dis-roundtrip.sh @@ -32,6 +32,7 @@ fail() { [ -x "$DIS34" ] || fail "dis34 not found or not executable: $DIS34" TMP=$(mktemp -d "${TMPDIR:-/tmp}/m1-dis34.XXXXXX") +FAIL_LOG=${M1_DIS_FAIL_LOG:-${TMPDIR:-/tmp}/m1-dis34-failure.txt} trap 'rm -rf "$TMP"' EXIT HUP INT TERM # Read little-endian fields out of the COFF. od keeps this dependency-free. @@ -179,8 +180,11 @@ expect_at() { seen { print " " $0; n++ } seen && n >= 3 { exit } ' "$TMP/dis34.txt" - echo " full disassembly: $TMP/dis34.txt (kept until exit; rerun with" - echo " DIS34=... if it has already been removed)" + if cp "$TMP/dis34.txt" "$FAIL_LOG" 2>/dev/null; then + echo " full disassembly preserved at: $FAIL_LOG" + else + echo " full disassembly: $TMP/dis34.txt (temporary; removed on exit)" + fi } >&2 exit 1 } diff --git a/scripts/m1/run.sh b/scripts/m1/run.sh index 728a25b..c0af136 100755 --- a/scripts/m1/run.sh +++ b/scripts/m1/run.sh @@ -104,6 +104,8 @@ timeout "${DOSBOX_TIMEOUT:-300}" "$DOSBOX" -conf "$DOSBOX_CONF" \ sed 's/\r$//' "$SDK/M1.LST" > "$WORK/m1.lst" grep -q 'No Errors' "$WORK/m1.lst" \ || { grep -i -B2 -A2 'error' "$WORK/m1.lst" >&2 || true; fail "GSPA reported errors"; } +grep -q 'No Warnings' "$WORK/m1.lst" \ + || { grep -i -B2 -A2 'warning' "$WORK/m1.lst" >&2 || true; fail "GSPA reported warnings"; } [ -f "$SDK/M1.OUT" ] || fail "GSPLNK produced no M1.OUT" sed 's/\r$//' "$SDK/M1.MAP" > "$WORK/m1.map" cp "$SDK/M1.OUT" "$COFF" diff --git a/scripts/tests/m1/run.sh b/scripts/tests/m1/run.sh index c9f222b..f8e8ba5 100755 --- a/scripts/tests/m1/run.sh +++ b/scripts/tests/m1/run.sh @@ -1,5 +1,5 @@ #!/bin/sh -# M1 test gate: compile four C functions, assemble/link with GSPA/GSPLNK, +# M1 test gate: compile six C functions, assemble/link with GSPA/GSPLNK, # load the COFF in MAME and check the marker words. set -eu ROOT=$(cd "$(dirname "$0")/../../.." && pwd) diff --git a/scripts/tms-clang b/scripts/tms-clang index e65911f..8c6aa9e 100755 --- a/scripts/tms-clang +++ b/scripts/tms-clang @@ -1,10 +1,11 @@ #!/bin/sh -# tms-clang -- M0 pipeline: clang IR, scale GEPs, optimize, normalize GEPs. +# tms-clang -- M1 IR pipeline: clang IR, scale GEPs, optimize, normalize GEPs. # # Usage: tms-clang [-O0|-O2] [-I dir] -o OUT.ll IN.c # # -O2 (the default) scales, optimizes, then normalizes; -O0 skips the optimizer. -# No machine code is produced in M0. +# The output is normalized IR for llc -march=tms34010; this wrapper does not +# invoke llc itself. set -eu ROOT=$(cd "$(dirname "$0")/.." && pwd)