//! returns: 0 @intrinsic extern fn ecall(number: u32, arg1: i64, arg2: i64, arg3: i64, arg4: i64) -> i64; /// Test that ecall can pass and return i64 values. @default fn main() -> i32 { // ecall(64, fd, buf, len, 0) = write(fd, buf, len). let msg: *[u8] = "ok\n"; // Write to stdout. The pointer is passed as i64. let n = ecall(64, 1, msg.ptr as i64, msg.len as i64, 0); // Return value should be 3 (bytes written). if n != 3 { return 1; } return 0; }