compiler/
kernel/
lib/
scripts/
seed/
sublime/
test/
acceptance/
boot/
bootstrap/
cycles/
dispatch/
loader/
mmio/
modules/
run
1009 B
native/
packages/
pages/
runtime/
scheduling/
shared/
slots/
smp/
sync/
termination/
tests/
trap/
run
2.7 KiB
runner.rad
10.3 KiB
vim/
.gitignore
336 B
.gitsigners
112 B
CONTRIBUTING
2.1 KiB
LICENSE
1.1 KiB
Makefile
10.2 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.5 KiB
std.lib.test
551 B
test/modules/run
raw
| 1 | #!/bin/sh |
| 2 | # Resolve and execute references beyond module index 127. |
| 3 | set -eu |
| 4 | emulator=${RAD_EMULATOR:-emulator} |
| 5 | work=$(mktemp -d) |
| 6 | trap 'rm -rf "$work"' EXIT HUP INT TERM |
| 7 | mkdir "$work/capacity" |
| 8 | set -- -pkg capacity -mod "$work/capacity.rad" |
| 9 | index=0 |
| 10 | while [ "$index" -lt 127 ]; do |
| 11 | printf 'export mod m%s;\n' "$index" >> "$work/capacity.rad" |
| 12 | printf '/// Return this module index.\nexport fn value() -> u64 { return %s; }\n' "$index" > "$work/capacity/m$index.rad" |
| 13 | set -- "$@" -mod "$work/capacity/m$index.rad" |
| 14 | index=$((index + 1)) |
| 15 | done |
| 16 | printf 'use capacity::m126;\n/// Check a package root beyond module index 127.\n@default fn main() -> u64 { assert m126::value() == 126; return 0; }\n' > "$work/entry.rad" |
| 17 | set -- "$@" -pkg entry -mod "$work/entry.rad" |
| 18 | "$emulator" -memory-size=385024 -data-size=348160 -stack-size=1024 \ |
| 19 | -run bin/radiance.rv64.dev "$@" -entry entry -o "$work/capacity.rv64" |
| 20 | "$emulator" -run "$work/capacity.rv64" |
| 21 | printf 'module scopes: references beyond index 127 passed\n' |