Skip to content

Commit 23f9c8d

Browse files
committed
[test] Account for one-pass implementations in more places
1 parent 28c3c7a commit 23f9c8d

6 files changed

Lines changed: 30 additions & 5 deletions

File tree

test/core/binary.wast

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,7 @@
13511351
(assert_malformed
13521352
(module binary
13531353
"\00asm" "\01\00\00\00"
1354+
"\01\04\01\60\00\00" ;; Type section
13541355
"\03\02\01\00" ;; Function section
13551356
"\08\01\00" ;; Start section: function 0
13561357
"\07\01\00" ;; Export section with zero entries
@@ -1362,6 +1363,7 @@
13621363
(assert_malformed
13631364
(module binary
13641365
"\00asm" "\01\00\00\00"
1366+
"\01\04\01\60\00\00" ;; Type section
13651367
"\03\02\01\00" ;; Function section
13661368
"\09\01\00" ;; Element section with zero entries
13671369
"\08\01\00" ;; Start section: function 0

test/core/data.wast

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,12 @@
412412
"type mismatch"
413413
)
414414

415+
(module
416+
(global (export "global-i32") i32 (i32.const 0))
417+
(global (export "global-mut-i32") (mut i32) (i32.const 0))
418+
)
419+
(register "test")
420+
415421
(assert_invalid
416422
(module
417423
(global (import "test" "global-i32") i32)
@@ -464,7 +470,7 @@
464470

465471
(assert_invalid
466472
(module
467-
(global $g (import "test" "g") (mut i32))
473+
(global $g (import "test" "global-mut-i32") (mut i32))
468474
(memory 1)
469475
(data (global.get $g))
470476
)

test/core/elem.wast

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,12 @@
403403
"type mismatch"
404404
)
405405

406+
(module
407+
(global (export "global-i32") i32 (i32.const 0))
408+
(global (export "global-mut-i32") (mut i32) (i32.const 0))
409+
)
410+
(register "test")
411+
406412
(assert_invalid
407413
(module
408414
(global (import "test" "global-i32") i32)
@@ -456,7 +462,7 @@
456462

457463
(assert_invalid
458464
(module
459-
(global $g (import "test" "g") (mut i32))
465+
(global $g (import "test" "global-mut-i32") (mut i32))
460466
(table 1 funcref)
461467
(elem (global.get $g))
462468
)

test/core/global.wast

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,8 +328,15 @@
328328
"type mismatch"
329329
)
330330

331+
(module
332+
(global (export "extern") externref (ref.null extern))
333+
(global (export "global-i32") i32 (i32.const 0))
334+
(global (export "global-mut-i32") (mut i32) (i32.const 0))
335+
)
336+
(register "test")
337+
331338
(assert_invalid
332-
(module (global (import "" "") externref) (global funcref (global.get 0)))
339+
(module (global (import "test" "extern") externref) (global funcref (global.get 0)))
333340
"type mismatch"
334341
)
335342

test/core/imports.wast

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,14 @@
485485
(assert_trap (invoke "load" (i32.const 1000000)) "out of bounds memory access")
486486

487487
(assert_invalid
488-
(module (import "" "" (memory 1)) (import "" "" (memory 1)))
488+
(module
489+
(import "test" "memory-2-inf" (memory 2))
490+
(import "spectest" "memory" (memory 1))
491+
)
489492
"multiple memories"
490493
)
491494
(assert_invalid
492-
(module (import "" "" (memory 1)) (memory 0))
495+
(module (import "spectest" "memory" (memory 1)) (memory 0))
493496
"multiple memories"
494497
)
495498
(assert_invalid

test/core/ref_func.wast

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
(module
22
(func (export "f") (param $x i32) (result i32) (local.get $x))
3+
(func (export "g") (param $x i32) (result i32) (i32.add (local.get $x) (i32.const 2)))
34
)
45
(register "M")
56

0 commit comments

Comments
 (0)