File tree 4 files changed +42
-42
lines changed
proposals/exception-handling
4 files changed +42
-42
lines changed Original file line number Diff line number Diff line change 378
378
(assert_trap (invoke " call" (i32.const 3 )) " uninitialized element" )
379
379
(assert_trap (invoke " call" (i32.const 100 )) " undefined element" )
380
380
381
-
382
381
(module
383
382
(import " spectest" " table" (table 0 funcref ))
384
383
(import " spectest" " table" (table 0 funcref ))
578
577
(assert_return (invoke " grow" (i32.const 1 )) (i32.const -1 ))
579
578
(assert_return (invoke " grow" (i32.const 0 )) (i32.const 2 ))
580
579
581
- (module $Mgm
582
- (memory (export " memory" ) 1 ) ;; initial size is 1
583
- (func (export " grow" ) (result i32 ) (memory.grow (i32.const 1 )))
584
- )
585
- (register " grown-memory" $Mgm )
586
- (assert_return (invoke $Mgm " grow" ) (i32.const 1 )) ;; now size is 2
587
- (module $Mgim1
588
- ;; imported memory limits should match, because external memory size is 2 now
589
- (memory (export " memory" ) (import " grown-memory" " memory" ) 2 )
590
- (func (export " grow" ) (result i32 ) (memory.grow (i32.const 1 )))
591
- )
592
- (register " grown-imported-memory" $Mgim1 )
593
- (assert_return (invoke $Mgim1 " grow" ) (i32.const 2 )) ;; now size is 3
594
- (module $Mgim2
595
- ;; imported memory limits should match, because external memory size is 3 now
596
- (import " grown-imported-memory" " memory" (memory 3 ))
597
- (func (export " size" ) (result i32 ) (memory.size ))
598
- )
599
- (assert_return (invoke $Mgim2 " size" ) (i32.const 3 ))
600
-
601
580
602
581
;; Syntax errors
603
582
Original file line number Diff line number Diff line change 309
309
(assert_return (invoke " as-memory.grow-size" ) (i32.const 1 ))
310
310
311
311
312
+ (module $Mgm
313
+ (memory (export " memory" ) 1 ) ;; initial size is 1
314
+ (func (export " grow" ) (result i32 ) (memory.grow (i32.const 1 )))
315
+ )
316
+ (register " grown-memory" $Mgm )
317
+ (assert_return (invoke $Mgm " grow" ) (i32.const 1 )) ;; now size is 2
318
+ (module $Mgim1
319
+ ;; imported memory limits should match, because external memory size is 2 now
320
+ (memory (export " memory" ) (import " grown-memory" " memory" ) 2 )
321
+ (func (export " grow" ) (result i32 ) (memory.grow (i32.const 1 )))
322
+ )
323
+ (register " grown-imported-memory" $Mgim1 )
324
+ (assert_return (invoke $Mgim1 " grow" ) (i32.const 2 )) ;; now size is 3
325
+ (module $Mgim2
326
+ ;; imported memory limits should match, because external memory size is 3 now
327
+ (import " grown-imported-memory" " memory" (memory 3 ))
328
+ (func (export " size" ) (result i32 ) (memory.size ))
329
+ )
330
+ (assert_return (invoke $Mgim2 " size" ) (i32.const 3 ))
331
+
332
+
312
333
(assert_invalid
313
334
(module
314
335
(memory 0 )
Original file line number Diff line number Diff line change 410
410
(assert_trap (invoke " call" (i32.const 3 )) " uninitialized element" )
411
411
(assert_trap (invoke " call" (i32.const 100 )) " undefined element" )
412
412
413
-
414
413
(module
415
414
(import " spectest" " table" (table 0 funcref ))
416
415
(import " spectest" " table" (table 0 funcref ))
610
609
(assert_return (invoke " grow" (i32.const 1 )) (i32.const -1 ))
611
610
(assert_return (invoke " grow" (i32.const 0 )) (i32.const 2 ))
612
611
613
- (module $Mgm
614
- (memory (export " memory" ) 1 ) ;; initial size is 1
615
- (func (export " grow" ) (result i32 ) (memory.grow (i32.const 1 )))
616
- )
617
- (register " grown-memory" $Mgm )
618
- (assert_return (invoke $Mgm " grow" ) (i32.const 1 )) ;; now size is 2
619
- (module $Mgim1
620
- ;; imported memory limits should match, because external memory size is 2 now
621
- (memory (export " memory" ) (import " grown-memory" " memory" ) 2 )
622
- (func (export " grow" ) (result i32 ) (memory.grow (i32.const 1 )))
623
- )
624
- (register " grown-imported-memory" $Mgim1 )
625
- (assert_return (invoke $Mgim1 " grow" ) (i32.const 2 )) ;; now size is 3
626
- (module $Mgim2
627
- ;; imported memory limits should match, because external memory size is 3 now
628
- (import " grown-imported-memory" " memory" (memory 3 ))
629
- (func (export " size" ) (result i32 ) (memory.size ))
630
- )
631
- (assert_return (invoke $Mgim2 " size" ) (i32.const 3 ))
632
-
633
612
634
613
;; Syntax errors
635
614
Original file line number Diff line number Diff line change 108
108
(assert_return (invoke " check-table-null" (i32.const 0 ) (i32.const 19 )) (ref.null func ))
109
109
110
110
111
+ (module $Tgt
112
+ (table (export " table" ) 1 funcref ) ;; initial size is 1
113
+ (func (export " grow" ) (result i32 ) (table.grow (ref.null func ) (i32.const 1 )))
114
+ )
115
+ (register " grown-table" $Tgt )
116
+ (assert_return (invoke $Tgt " grow" ) (i32.const 1 )) ;; now size is 2
117
+ (module $Tgit1
118
+ ;; imported table limits should match, because external table size is 2 now
119
+ (table (export " table" ) (import " grown-table" " table" ) 2 funcref )
120
+ (func (export " grow" ) (result i32 ) (table.grow (ref.null func ) (i32.const 1 )))
121
+ )
122
+ (register " grown-imported-table" $Tgit1 )
123
+ (assert_return (invoke $Tgit1 " grow" ) (i32.const 2 )) ;; now size is 3
124
+ (module $Tgit2
125
+ ;; imported table limits should match, because external table size is 3 now
126
+ (import " grown-imported-table" " table" (table 3 funcref ))
127
+ (func (export " size" ) (result i32 ) (table.size ))
128
+ )
129
+ (assert_return (invoke $Tgit2 " size" ) (i32.const 3 ))
130
+
131
+
111
132
;; Type errors
112
133
113
134
(assert_invalid
You can’t perform that action at this time.
0 commit comments