forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.wast
More file actions
43 lines (34 loc) · 999 Bytes
/
Copy pathevents.wast
File metadata and controls
43 lines (34 loc) · 999 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;; Test events
(module
(event (attr 0) (param i32))
(event $e (attr 0) (param i32 f32))
(event $e-params0 (attr 0) (param i32 f32))
(event $e-params1 (attr 0) (param i32) (param f32))
(event $e-export (export "ex0") (attr 0) (param i32))
(event $e-import (import "env" "im0") (attr 0) (param i32))
(import "env" "im1" (event (attr 0) (param i32 f32)))
(export "ex1" (event $e))
)
(assert_invalid
(module (event $e (attr 0) (param i32) (result i32)))
"Event type's result type should be none"
)
(assert_invalid
(module (event $e (attr 0)))
"There should be 1 or more values in an event type"
)
(assert_invalid
(module (event $e (attr 1) (param i32)))
"Currently only attribute 0 is supported"
)
(assert_invalid
(module (event $e (attr 0) (param except_ref)))
"Values in an event should have integer or float type"
)
(assert_invalid
(module
(type $t (param i32))
(event $e (attr 0) (type $t) (param i32 f32))
"type and param don't match"
)
)