summaryrefslogtreecommitdiff
path: root/test/spec/struct.wast
diff options
context:
space:
mode:
Diffstat (limited to 'test/spec/struct.wast')
-rw-r--r--test/spec/struct.wast31
1 files changed, 7 insertions, 24 deletions
diff --git a/test/spec/struct.wast b/test/spec/struct.wast
index bac4d4520..5bc8e2f2e 100644
--- a/test/spec/struct.wast
+++ b/test/spec/struct.wast
@@ -28,7 +28,7 @@
(struct.get $vec 0 (local.get $v))
)
(func (export "get_0") (result f32)
- (call $get_0 (struct.new_default_with_rtt $vec (rtt.canon $vec)))
+ (call $get_0 (struct.new_default $vec))
)
(func $set_get_y (param $v (ref $vec)) (param $y f32) (result f32)
@@ -36,7 +36,7 @@
(struct.get $vec $y (local.get $v))
)
(func (export "set_get_y") (param $y f32) (result f32)
- (call $set_get_y (struct.new_default_with_rtt $vec (rtt.canon $vec)) (local.get $y))
+ (call $set_get_y (struct.new_default $vec) (local.get $y))
)
(func $set_get_1 (param $v (ref $vec)) (param $y f32) (result f32)
@@ -44,7 +44,7 @@
(struct.get $vec $y (local.get $v))
)
(func (export "set_get_1") (param $y f32) (result f32)
- (call $set_get_1 (struct.new_default_with_rtt $vec (rtt.canon $vec)) (local.get $y))
+ (call $set_get_1 (struct.new_default $vec) (local.get $y))
)
)
@@ -82,29 +82,12 @@
(module
(type $t (struct (field i32) (field (mut i32))))
(func (export "struct.new-null")
- (local (ref null (rtt $t))) (drop (struct.new $t (i32.const 1) (i32.const 2) (local.get 0)))
+ (local i64)
+ (drop (struct.new $t (i32.const 1) (i32.const 2) (local.get 0)))
)
)
"type mismatch"
)
-(assert_invalid
- (module
- (type $t (struct (field i32) (field (mut i32))))
- (func (export "struct.new_default-null")
- (local (ref null (rtt $t))) (drop (struct.new_default_with_rtt $t (local.get 0)))
- )
- )
- "type mismatch"
-)
-
-(assert_invalid
- (module
- (type $A (struct (field i32)))
- (type $B (struct (field i64)))
- (global $glob (rtt $A) (rtt.sub $A (rtt.canon $B)))
- )
- "invalid rtt"
-)
(assert_invalid
(module
@@ -112,7 +95,7 @@
(func $test
(drop
;; too many arguments
- (struct.new_with_rtt $vec (i32.const 1) (i32.const 2) (rtt.canon $vec))
+ (struct.new $vec (i32.const 1) (i32.const 2))
)
)
)
@@ -125,7 +108,7 @@
(func $test
(drop
;; too few arguments
- (struct.new_with_rtt $vec (i32.const 1) (rtt.canon $vec))
+ (struct.new $vec (i32.const 1))
)
)
)