2020-05-21 12:35:18 +08:00
|
|
|
.globl bar
|
|
|
|
bar:
|
|
|
|
.functype bar () -> (i64)
|
|
|
|
i64.const 1
|
|
|
|
end_function
|
|
|
|
|
|
|
|
.globl call_bar_indirect
|
|
|
|
call_bar_indirect:
|
|
|
|
.functype call_bar_indirect () -> ()
|
2020-11-30 21:56:57 +08:00
|
|
|
i32.const 0
|
2020-05-21 12:35:18 +08:00
|
|
|
i32.load indirect_bar
|
|
|
|
call_indirect () -> (i64)
|
|
|
|
drop
|
2020-11-30 21:56:57 +08:00
|
|
|
i32.const 0
|
2020-05-21 12:35:18 +08:00
|
|
|
i32.load indirect_foo
|
|
|
|
call_indirect () -> (i32)
|
|
|
|
drop
|
|
|
|
end_function
|
|
|
|
|
|
|
|
.section .data.indirect_bar,"",@
|
|
|
|
indirect_bar:
|
|
|
|
.int32 bar
|
|
|
|
.size indirect_bar, 4
|
|
|
|
|
|
|
|
.section .data.indirect_foo,"",@
|
|
|
|
indirect_foo:
|
|
|
|
.int32 foo
|
|
|
|
.size indirect_foo, 4
|
|
|
|
|
|
|
|
.functype foo () -> (i32)
|