diff options
| author | kx <kx@radix-linux.su> | 2026-10-09 18:00:15 +0300 |
|---|---|---|
| committer | kx <kx@radix-linux.su> | 2026-10-09 18:00:15 +0300 |
| commit | 065da3509019b15dd0e678072e6be629e5330bef (patch) | |
| tree | 69c934c9e786ac048b4fbe8f4c4c5571661521f4 /tests/tst-verbose-runner.sh | |
| parent | d130fe27fa753be02ed76fd9b277aa3c3d928eb9 (diff) | |
| download | libmcpu-0.4.0.tar.xz | |
Version 0.4.00.4.0
Diffstat (limited to 'tests/tst-verbose-runner.sh')
| -rwxr-xr-x | tests/tst-verbose-runner.sh | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/tests/tst-verbose-runner.sh b/tests/tst-verbose-runner.sh new file mode 100755 index 0000000..e1362e4 --- /dev/null +++ b/tests/tst-verbose-runner.sh @@ -0,0 +1,68 @@ +#!/bin/sh +set -eu + +: "${CPU_AS:?}" "${CPU_LD:?}" "${TEST_SRCDIR:?}" + +TMP=${TMPDIR:-/tmp}/libmcpu-verbose-$$ +mkdir -p "$TMP" +trap 'rm -rf "$TMP"' EXIT HUP INT TERM + +src="$TEST_SRCDIR/fixtures/radd-pi.s" + +# Production default is quiet: successful assembly and linking write no +# developer summary unless -v/--verbose is requested. +out=`"$CPU_AS" -o "$TMP/main.o" "$src"` +[ -z "$out" ] + +out=`"$CPU_LD" --stack-size=512 --no-heap -o "$TMP/main" "$TMP/main.o"` +[ -z "$out" ] + +# Both spellings enable the existing developer summaries without changing +# their content or the generated object/executable semantics. +out=`"$CPU_AS" -v -o "$TMP/main-v.o" "$src"` +case "$out" in + "MELF ET_REL: "*" -> $TMP/main-v.o") ;; + *) echo "unexpected mcpu-as -v output: $out" >&2; exit 1 ;; +esac + +out=`"$CPU_AS" --verbose -o "$TMP/main-long.o" "$src"` +case "$out" in + "MELF ET_REL: "*" -> $TMP/main-long.o") ;; + *) echo "unexpected mcpu-as --verbose output: $out" >&2; exit 1 ;; +esac + +out=`"$CPU_LD" -v --stack-size=512 --no-heap \ + -o "$TMP/main-v" "$TMP/main-v.o"` +case "$out" in + "MELF ABI1 ET_EXEC: "*" -> $TMP/main-v") ;; + *) echo "unexpected mcpu-ld -v output: $out" >&2; exit 1 ;; +esac + +out=`"$CPU_LD" --verbose --dynamic --stack-size=512 --no-heap \ + -o "$TMP/main-dyn" "$TMP/main-long.o"` +case "$out" in + "MELF ABI3 ET_EXEC: "*" -> $TMP/main-dyn") ;; + *) echo "unexpected mcpu-ld --verbose dynamic output: $out" >&2; exit 1 ;; +esac + +out=`"$CPU_LD" -v -r -o "$TMP/main-partial.o" "$TMP/main-v.o"` +case "$out" in + "MELF ET_REL partial link: "*" -> $TMP/main-partial.o") ;; + *) echo "unexpected mcpu-ld -v -r output: $out" >&2; exit 1 ;; +esac + +cat > "$TMP/shared.s" <<'EOS' +.global shared_value +.text +shared_value: + RET +EOS +"$CPU_AS" -o "$TMP/shared.o" "$TMP/shared.s" +out=`"$CPU_LD" --verbose --shared --soname=libverbose.so.1 \ + -o "$TMP/libverbose.so" "$TMP/shared.o"` +case "$out" in + "MELF ABI3 ET_DYN: "*" -> $TMP/libverbose.so") ;; + *) echo "unexpected mcpu-ld --verbose shared output: $out" >&2; exit 1 ;; +esac + +exit 0 |
