mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-18 01:11:32 +00:00
mimic typed enums
This commit is contained in:
@ -3,10 +3,16 @@
|
||||
(memory $0 1)
|
||||
(data (i32.const 8) "\07\00\00\00w\00a\00s\00i\00.\00t\00s")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $start)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $wasi/sig (mut i32) (i32.const 1))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
(start $start)
|
||||
(func $start (; 0 ;) (type $FUNCSIG$v)
|
||||
i32.const 9
|
||||
global.set $wasi/sig
|
||||
)
|
||||
(func $null (; 1 ;) (type $FUNCSIG$v)
|
||||
nop
|
||||
)
|
||||
)
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription } from "bindings/wasi";
|
||||
import { dirent, rwevent, fdstat, filestat, iovec, clocksubscription, fdsubscription, signal } from "bindings/wasi";
|
||||
|
||||
// TODO: WASM64
|
||||
|
||||
@ -48,3 +48,7 @@ assert(offsetof<fdsubscription>("userdata") == 0);
|
||||
assert(offsetof<fdsubscription>("type") == 8);
|
||||
assert(offsetof<fdsubscription>("fd") == 16);
|
||||
assert(offsetof<fdsubscription>() == 20);
|
||||
|
||||
// check assignability of mimicked typed enums
|
||||
var sig: signal = signal.HUP;
|
||||
sig = signal.KILL;
|
||||
|
@ -6,6 +6,7 @@
|
||||
(data (i32.const 8) "\07\00\00\00w\00a\00s\00i\00.\00t\00s\00")
|
||||
(table $0 1 funcref)
|
||||
(elem (i32.const 0) $null)
|
||||
(global $wasi/sig (mut i32) (i32.const 1))
|
||||
(global $~lib/memory/HEAP_BASE i32 (i32.const 28))
|
||||
(export "memory" (memory $0))
|
||||
(export "table" (table $0))
|
||||
@ -491,6 +492,8 @@
|
||||
call $~lib/env/abort
|
||||
unreachable
|
||||
end
|
||||
i32.const 9
|
||||
global.set $wasi/sig
|
||||
)
|
||||
(func $start (; 2 ;) (type $FUNCSIG$v)
|
||||
call $start:wasi
|
||||
|
Reference in New Issue
Block a user