feat: add lab-rv32i-c-smalloc-sbrk-libc card

This commit is contained in:
user
2026-07-21 19:14:20 +02:00
commit d522c15f75
33 changed files with 5965 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -euo pipefail
root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)"
if [[ "${1:-}" != "--already-built" ]]; then
make -C "$root" PROFILE=observe host >/dev/null
fi
check_output() {
local program="$1" expected="$2" actual
actual="$($program)"
if [[ "$actual" != "$expected" ]]; then
printf 'FAIL %s\nexpected: %s\nactual: %s\n' \
"$program" "$expected" "$actual" >&2
return 1
fi
printf 'PASS %s: %s\n' "$(basename -- "$(dirname -- "$program")")" "$actual"
}
check_output "$root/host-build/task01_libc_without_heap/prog" \
'length=16 pass=1'
check_output "$root/host-build/task03_bounded_sbrk/prog" \
'grow=40 rejected_grow=40 shrink=32 rejected_shrink=32 preserved=1 bounds=1 pass=1'
check_output "$root/host-build/task04_smalloc/prog" \
'header=16 first=32 second=48 delta=32 aligned=1 metadata=1 append=1 reset=1 pass=1'
check_output "$root/host-build/task05_picolibc_malloc/prog" \
'nonnull=1 delta_nonzero=1 checksum=4612 nonoverlap=1 aligned=1 freed=1 pass=1'