compiler/
kernel/
lib/
scripts/
seed/
sublime/
test/
acceptance/
boot/
bootstrap/
cycles/
dispatch/
loader/
kernel/
loaded.rad
513 B
machine.ras
711 B
run
1.7 KiB
mmio/
native/
packages/
pages/
runtime/
scheduling/
shared/
slots/
smp/
support/
sync/
termination/
tests/
trap/
package-golden
1.6 KiB
run
3.1 KiB
runner.rad
10.5 KiB
vim/
.gitignore
336 B
.gitsigners
112 B
CONTRIBUTING
2.1 KiB
LICENSE
1.1 KiB
Makefile
9.2 KiB
README
2.5 KiB
STYLE
2.5 KiB
std.lib
1.5 KiB
std.lib.test
662 B
test/loader/loaded.rad
raw
| 1 | //! A package executed by both hosted compilation and the kernel loader. |
| 2 | |
| 3 | /// Counter owned by each package instance. |
| 4 | static counter: i64 = 1; |
| 5 | /// Relocated slice pointing into this instance's initialized data. |
| 6 | static factor: *[u8] = "6"; |
| 7 | |
| 8 | /// Compute a result through a package-local call. |
| 9 | fn calculate(value: i64) -> i64 { |
| 10 | set counter += value * (factor[0] as i64 - 48); |
| 11 | return counter; |
| 12 | } |
| 13 | |
| 14 | /// Return the result checked by both execution paths. |
| 15 | @default fn main() -> i32 { return calculate(7) as i32; } |