test/shared/run 636 B raw
1
#!/bin/sh
2
# Compile two packages once and execute them with two private state graphs.
3
set -eu
4
emulator=${RAD_EMULATOR:-emulator}
5
work=$(mktemp -d)
6
trap 'rm -rf "$work"' EXIT HUP INT TERM
7
"$emulator" -memory-size=385024 -data-size=348160 -stack-size=1024 \
8
    -run bin/radiance.rv64.dev \
9
    -pkg support -mod test/shared/support.rad \
10
    -pkg app -mod test/shared/app.rad -entry app -ril "$work"
11
"$emulator" -run bin/shared.build.rv64 -- "$work/support.ril" "$work/app.ril" "$work/native.rv64"
12
"$emulator" -machine -run "$work/native.rv64"
13
printf 'shared packages: calls, callbacks, private pointers, and independent state passed\n'