mirror of
https://github.com/fluencelabs/parity-wasm
synced 2025-05-28 15:11:36 +00:00
no-std example
This commit is contained in:
parent
361280897f
commit
cac5de598f
26
res/cases/v1/test5.rs
Normal file
26
res/cases/v1/test5.rs
Normal file
@ -0,0 +1,26 @@
|
||||
#![feature(link_args)]
|
||||
#![feature(lang_items)]
|
||||
#![feature(start)]
|
||||
#![no_std]
|
||||
|
||||
#[lang="panic_fmt"]
|
||||
extern fn panic_fmt(_: ::core::fmt::Arguments, _: &'static str, _: u32) -> ! {
|
||||
}
|
||||
|
||||
#[lang = "eh_personality"]
|
||||
extern fn eh_personality() {
|
||||
}
|
||||
|
||||
#[link_args = "-s EXPORTED_FUNCTIONS=['_hello_world']"]
|
||||
extern {}
|
||||
|
||||
#[no_mangle]
|
||||
pub fn hello_world() -> isize {
|
||||
45 + 99
|
||||
}
|
||||
|
||||
#[start]
|
||||
fn main(argc: isize, argv: *const *const u8) -> isize {
|
||||
/* Intentionally left blank */
|
||||
0
|
||||
}
|
BIN
res/cases/v1/test5.wasm
Normal file
BIN
res/cases/v1/test5.wasm
Normal file
Binary file not shown.
9841
res/cases/v1/test5.wast
Normal file
9841
res/cases/v1/test5.wast
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user