summaryrefslogtreecommitdiff
path: root/test/spec
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2024-06-17 11:16:20 -0700
committerGitHub <noreply@github.com>2024-06-17 18:16:20 +0000
commitd849a43040dfc21d1593283ad38a12a3bd80e17c (patch)
tree7108e97aaff704aa94133d066fc681585a488264 /test/spec
parentcf2725b434c724fdcac89f5c2a21e09f33f5a121 (diff)
downloadbinaryen-d849a43040dfc21d1593283ad38a12a3bd80e17c.tar.gz
binaryen-d849a43040dfc21d1593283ad38a12a3bd80e17c.tar.bz2
binaryen-d849a43040dfc21d1593283ad38a12a3bd80e17c.zip
Enable more spec tests (#6669)
Re-triage all the disabled spec tests and re-enable many of them. Improve the module splitting logic to correctly handle (by skipping) quoted modules and their associated assertions.
Diffstat (limited to 'test/spec')
-rw-r--r--test/spec/stack.wast51
1 files changed, 33 insertions, 18 deletions
diff --git a/test/spec/stack.wast b/test/spec/stack.wast
index a8c79b698..5da5043c8 100644
--- a/test/spec/stack.wast
+++ b/test/spec/stack.wast
@@ -34,17 +34,15 @@
(i64.eq)
(if
(then (br $done))
- (then
- (else
- (local.get $i)
- (local.get $res)
- (i64.mul)
- (local.set $res)
- (local.get $i)
- (i64.const 1)
- (i64.sub)
- (local.set $i)
- )
+ (else
+ (local.get $i)
+ (local.get $res)
+ (i64.mul)
+ (local.set $res)
+ (local.get $i)
+ (i64.const 1)
+ (i64.sub)
+ (local.set $i)
)
)
(br $loop)
@@ -93,13 +91,11 @@
(i64.eq (local.get $i) (i64.const 0))
(if
(then (br $done))
- (then
- (else
- (i64.mul (local.get $i) (local.get $res))
- (local.set $res)
- (i64.sub (local.get $i) (i64.const 1))
- (local.set $i)
- )
+ (else
+ (i64.mul (local.get $i) (local.get $res))
+ (local.set $res)
+ (i64.sub (local.get $i) (i64.const 1))
+ (local.set $i)
)
)
(br $loop)
@@ -129,12 +125,31 @@
end
local.get $res
)
+
+ (global $temp (mut i32) (i32.const 0))
+ (func $add_one_to_global (result i32)
+ (local i32)
+ (global.set $temp (i32.add (i32.const 1) (global.get $temp)))
+ (global.get $temp)
+ )
+ (func $add_one_to_global_and_drop
+ (drop (call $add_one_to_global))
+ )
+ (func (export "not-quite-a-tree") (result i32)
+ call $add_one_to_global
+ call $add_one_to_global
+ call $add_one_to_global_and_drop
+ i32.add
+ )
)
(assert_return (invoke "fac-expr" (i64.const 25)) (i64.const 7034535277573963776))
(assert_return (invoke "fac-stack" (i64.const 25)) (i64.const 7034535277573963776))
(assert_return (invoke "fac-mixed" (i64.const 25)) (i64.const 7034535277573963776))
+(assert_return (invoke "not-quite-a-tree") (i32.const 3))
+(assert_return (invoke "not-quite-a-tree") (i32.const 9))
+
;; Syntax of flat call_indirect