Skip to content

Commit

Permalink
Update repos
Browse files Browse the repository at this point in the history
  exception-handling:
    WebAssembly/exception-handling@24be4255
  gc:
    WebAssembly/gc@e8529784
  annotations:
    WebAssembly/annotations@97848ea3

This change was automatically generated by `update-testsuite.sh`
  • Loading branch information
WebAssembly/testsuite auto-update authored and sunfishcode committed Jul 22, 2024
1 parent 83f0863 commit 53da17c
Show file tree
Hide file tree
Showing 6 changed files with 361 additions and 2 deletions.
304 changes: 304 additions & 0 deletions proposals/annotations/token.wast
Original file line number Diff line number Diff line change
@@ -0,0 +1,304 @@
;; Test tokenization

(assert_malformed
(module quote "(func (drop (i32.const0)))")
"unknown operator"
)
(assert_malformed
(module quote "(func br 0drop)")
"unknown operator"
)


;; Tokens can be delimited by parentheses

(module
(func(nop))
)
(module
(func (nop)nop)
)
(module
(func nop(nop))
)
(module
(func(nop)(nop))
)
(module
(func $f(nop))
)
(module
(func br 0(nop))
)
(module
(table 1 funcref)
(func)
(elem (i32.const 0)0)
)
(module
(table 1 funcref)
(func $f)
(elem (i32.const 0)$f)
)
(module
(memory 1)
(data (i32.const 0)"a")
)
(module
(import "spectest" "print"(func))
)


;; Tokens can be delimited by comments

(module
(func;;bla
)
)
(module
(func (nop);;bla
)
)
(module
(func nop;;bla
)
)
(module
(func $f;;bla
)
)
(module
(func br 0;;bla
)
)
(module
(data "a";;bla
)
)


;; Space required between symbols and non-parenthesis tokens

(module
(func (block $l (i32.const 0) (br_table 0 $l)))
)
(assert_malformed
(module quote
"(func (block $l (i32.const 0) (br_table 0$l)))"
)
"unknown operator"
)
(assert_malformed
(module quote
"(func (block $l (i32.const 0) (br_table 0$\"l\")))"
)
"unknown operator"
)

(module
(func (block $l (i32.const 0) (br_table $l 0)))
)
(assert_malformed
(module quote
"(func (block $l (i32.const 0) (br_table $l0)))"
)
"unknown label"
)
(assert_malformed
(module quote
"(func (block $l (i32.const 0) (br_table $\"l\"0)))"
)
"unknown operator"
)

(module
(func (block $l (i32.const 0) (br_table $l $l)))
)
(assert_malformed
(module quote
"(func (block $l (i32.const 0) (br_table $l$l)))"
)
"unknown label"
)
(assert_malformed
(module quote
"(func (block $l (i32.const 0) (br_table $\"l\"$l)))"
)
"unknown operator"
)

(module
(func (block $l0 (i32.const 0) (br_table $l0)))
)
(module
(func (block $l$l (i32.const 0) (br_table $l$l)))
)


;; Space required between strings and non-parenthesis tokens

(module
(data "a")
)
(assert_malformed
(module quote
"(data\"a\")"
)
"unknown operator"
)

(module
(data $l "a")
)
(assert_malformed
(module quote
"(data $l\"a\")"
)
"unknown operator"
)

(module
(data $l " a")
)
(assert_malformed
(module quote
"(data $l\" a\")"
)
"unknown operator"
)

(module
(data $l "a ")
)
(assert_malformed
(module quote
"(data $l\"a \")"
)
"unknown operator"
)

(module
(data $l "a " "b")
)
(assert_malformed
(module quote
"(data $l\"a \"\"b\")"
)
"unknown operator"
)

(module
(data $l "")
)
(assert_malformed
(module quote
"(data $l\"\")"
)
"unknown operator"
)

(module
(data $l " ")
)
(assert_malformed
(module quote
"(data $l\" \")"
)
"unknown operator"
)

(module
(data $l " ")
)
(assert_malformed
(module quote
"(data $l\" \")"
)
"unknown operator"
)

(module
(data "a" "b")
)
(assert_malformed
(module quote
"(data \"a\"\"b\")"
)
"unknown operator"
)

(module
(data "a" " b")
)
(assert_malformed
(module quote
"(data \"a\"\" b\")"
)
"unknown operator"
)

(module
(data "a " "b")
)
(assert_malformed
(module quote
"(data \"a \"\"b\")"
)
"unknown operator"
)

(module
(data "" "")
)
(assert_malformed
(module quote
"(data \"\"\"\")"
)
"unknown operator"
)

(module
(data "" " ")
)
(assert_malformed
(module quote
"(data \"\"\" \")"
)
"unknown operator"
)

(module
(data " " "")
)
(assert_malformed
(module quote
"(data \" \"\"\")"
)
"unknown operator"
)


(assert_malformed
(module quote
"(func \"a\"x)"
)
"unknown operator"
)
(assert_malformed
(module quote
"(func \"a\"0)"
)
"unknown operator"
)
(assert_malformed
(module quote
"(func 0\"a\")"
)
"unknown operator"
)
(assert_malformed
(module quote
"(func \"a\"$x)"
)
"unknown operator"
)
6 changes: 6 additions & 0 deletions proposals/exception-handling/try_table.wast
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,10 @@
)
)
)

(func (export "try-with-param")
(i32.const 0) (try_table (param i32) (drop))
)
)

(assert_return (invoke "simple-throw-catch" (i32.const 0)) (i32.const 23))
Expand Down Expand Up @@ -294,6 +298,8 @@
(assert_exception (invoke "return-call-in-try-catch"))
(assert_exception (invoke "return-call-indirect-in-try-catch"))

(assert_return (invoke "try-with-param"))

(module
(func $imported-throw (import "test" "throw"))
(tag $e0)
Expand Down
10 changes: 10 additions & 0 deletions proposals/gc/call_ref.wast
Original file line number Diff line number Diff line change
Expand Up @@ -206,3 +206,13 @@
)
"type mismatch"
)

(assert_invalid
(module
(type $t (func))
(func $f (param $r funcref)
(call_ref $t (local.get $r))
)
)
"type mismatch"
)
10 changes: 9 additions & 1 deletion proposals/gc/return_call.wast
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,15 @@
)
"type mismatch"
)

(assert_invalid
(module
(func $f (result i32 i32) unreachable)
(func (result i32)
return_call $f
)
)
"type mismatch"
)

;; Unbound function

Expand Down
12 changes: 11 additions & 1 deletion proposals/gc/return_call_indirect.wast
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,17 @@
)
"type mismatch"
)

(assert_invalid
(module
(type $ty (func (result i32 i32)))
(import "env" "table" (table $table 0 funcref))
(func (param i32) (result i32)
local.get 0
return_call_indirect $table (type $ty)
)
)
"type mismatch"
)

;; Unbound type

Expand Down
21 changes: 21 additions & 0 deletions proposals/gc/return_call_ref.wast
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,24 @@
)
"type mismatch"
)

(assert_invalid
(module
(type $t (func))
(func $f (param $r funcref)
(return_call_ref $t (local.get $r))
)
)
"type mismatch"
)

(assert_invalid
(module
(type $ty (func (result i32 i32)))
(func (param (ref $ty)) (result i32)
local.get 0
return_call_ref $ty
)
)
"type mismatch"
)

0 comments on commit 53da17c

Please sign in to comment.