test/shared/app.rad 601 B raw
1
//! Shared entry with callbacks, initialized data pointers, and private counters.
2
3
use support;
4
5
/// Callback table contains a linked dependency function address.
6
static CALLBACKS: [fn() -> i32; 1] = [support::read];
7
/// The slice contains a pointer into this domain's string storage.
8
static TEXT: *[u8] = "xy";
9
/// Number of calls in the current domain.
10
static calls: i32 = 0;
11
12
/// Read dependency state through calls and data, then advance private state.
13
@default export fn main() -> i32 {
14
    set calls += 1;
15
    return support::read() + CALLBACKS[0]() + support::value + TEXT[0] as i32 + calls;
16
}