Skip to content

Commit 648c733

Browse files
committed
review: check global initializers
1 parent 56140b7 commit 648c733

File tree

1 file changed

+12
-0
lines changed
  • test/core/shared-everything-threads/shared-everything-threads

1 file changed

+12
-0
lines changed

test/core/shared-everything-threads/shared-everything-threads/globals.wast

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@
2626
(global (shared mut v128) (v128.const i64x2 0 0))
2727
)
2828

29+
;; Check that we can only use shared globals to initialize other shared globals.
30+
(module
31+
(global $a (shared i32) (i32.const 0))
32+
(global $b (shared i32) (global.get $a))
33+
)
34+
(assert_invalid
35+
(module
36+
(global $a i32 (i32.const 0))
37+
(global $b (shared i32) (global.get $a))
38+
)
39+
"invalid type")
40+
2941
(assert_malformed
3042
(module quote "(global (mut shared i64) (i64.const -1))")
3143
"unexpected token")

0 commit comments

Comments
 (0)