Skip to content

Commit efcc5cf

Browse files
committed
Update existing WASTs to follow adhere to #655
1 parent 1d20b88 commit efcc5cf

47 files changed

Lines changed: 344 additions & 344 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

test/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,16 @@ This directory contains Component Model reference tests, grouped by functionalit
66

77
A single `.wast` test can be run with full backtrace on trap via:
88
```
9-
WASMTIME_BACKTRACE_DETAILS=1 wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements the-test.wast
9+
WASMTIME_BACKTRACE_DETAILS=1 WAST_STRICT_COMPONENT_INDICES=1 wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements the-test.wast
1010
```
1111

1212
All the tests can be run from this directory via:
1313
```
14-
find . -name "*.wast" | xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements
14+
find . -name "*.wast" | WAST_STRICT_COMPONENT_INDICES=1 xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements
1515
```
1616

1717
Sometimes tests are landed ahead of the implementation and fail for a while.
1818
These tests are listed in 'nyi.txt' and can be filtered out via:
1919
```
20-
find . -name "*.wast" | grep -vxFf nyi.txt | xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements
20+
find . -name "*.wast" | grep -vxFf nyi.txt | WAST_STRICT_COMPONENT_INDICES=1 xargs wasmtime wast -W component-model-more-async-builtins -W component-model-threading -W component-model-async-stackful -W component-model-implements
2121
```

test/async/async-calls-sync.wast

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@
5555
))))
5656
(func (export "blocking-call") async (result u32) (canon lift
5757
(core func $core_async_inner "blocking-call")
58-
async (callback (func $core_async_inner "blocking-call-cb"))
58+
async (callback (core func $core_async_inner "blocking-call-cb"))
5959
))
6060
(func (export "unblock") async (canon lift
6161
(core func $core_async_inner "unblock")
62-
async (callback (func $core_async_inner "unblock-cb"))
62+
async (callback (core func $core_async_inner "unblock-cb"))
6363
))
6464
)
6565

@@ -101,7 +101,7 @@
101101
))))
102102
(func (export "sync-func") async (result u32) (canon lift
103103
(core func $core_sync_middle "sync-func")
104-
async (callback (func $core_sync_middle "sync-func-cb"))
104+
async (callback (core func $core_sync_middle "sync-func-cb"))
105105
))
106106
)
107107

@@ -199,8 +199,8 @@
199199
(canon waitable.join (core func $waitable.join))
200200
(canon waitable-set.new (core func $waitable-set.new))
201201
(canon lower (func $unblock) (core func $unblock))
202-
(canon lower (func $sync-func1) async (memory $memory "mem") (core func $sync-func1'))
203-
(canon lower (func $sync-func2) async (memory $memory "mem") (core func $sync-func2'))
202+
(canon lower (func $sync-func1) async (memory (core memory $memory "mem")) (core func $sync-func1'))
203+
(canon lower (func $sync-func2) async (memory (core memory $memory "mem")) (core func $sync-func2'))
204204
(core instance $em (instantiate $CoreAsyncOuter (with "" (instance
205205
(export "mem" (memory $memory "mem"))
206206
(export "task.return" (func $task.return))
@@ -213,7 +213,7 @@
213213
))))
214214
(func (export "run") async (result u32) (canon lift
215215
(core func $em "run")
216-
async (callback (func $em "run-cb"))
216+
async (callback (core func $em "run-cb"))
217217
))
218218
)
219219

test/async/big-interleaving-test.wast

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,9 @@
111111
(canon waitable.join (core func $waitable.join))
112112
(canon waitable-set.new (core func $waitable-set.new))
113113
(canon waitable-set.drop (core func $waitable-set.drop))
114-
(canon stream.read $ST async (memory $memory "mem") (core func $stream.read))
114+
(canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read))
115115
(canon stream.drop-readable $ST (core func $stream.drop-readable))
116-
(canon future.read $FT async (memory $memory "mem") (core func $future.read))
116+
(canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read))
117117
(canon future.drop-readable $FT (core func $future.drop-readable))
118118
(core instance $mm (instantiate $MM (with "" (instance
119119
(export "mem" (memory $memory "mem"))
@@ -131,13 +131,13 @@
131131
(export "future.read" (func $future.read))
132132
(export "future.drop-readable" (func $future.drop-readable))))))
133133
(func (export "sink") async (param "in" (stream u8)) (canon lift
134-
(core func $mm "sink") async (memory $memory "mem") (callback (func $mm "sink_cb"))))
134+
(core func $mm "sink") async (memory (core memory $memory "mem")) (callback (core func $mm "sink_cb"))))
135135
(func (export "sink-future") async (param "in" (future u8)) (canon lift
136-
(core func $mm "sink-future") async (memory $memory "mem") (callback (func $mm "sink-future_cb"))))
136+
(core func $mm "sink-future") async (memory (core memory $memory "mem")) (callback (core func $mm "sink-future_cb"))))
137137
(func (export "block-empty") async (canon lift
138-
(core func $mm "block-empty") async (memory $memory "mem") (callback (func $mm "block-empty_cb"))))
138+
(core func $mm "block-empty") async (memory (core memory $memory "mem")) (callback (core func $mm "block-empty_cb"))))
139139
(func (export "block-future") async (param "in" (future u8)) (canon lift
140-
(core func $mm "block-future") async (memory $memory "mem") (callback (func $mm "block-future_cb"))))
140+
(core func $mm "block-future") async (memory (core memory $memory "mem")) (callback (core func $mm "block-future_cb"))))
141141
(func (export "bp-inc") (canon lift (core func $mm "bp-inc")))
142142
(func (export "bp-dec") (canon lift (core func $mm "bp-dec")))
143143
)
@@ -342,31 +342,31 @@
342342
(type $ST (stream u8))
343343
(type $FT (future u8))
344344
(canon stream.new $ST (core func $stream.new))
345-
(canon stream.read $ST async (memory $memory "mem") (core func $stream.read))
346-
(canon stream.write $ST async (memory $memory "mem") (core func $stream.write))
345+
(canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read))
346+
(canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write))
347347
(canon stream.cancel-read $ST async (core func $stream.cancel-read))
348348
(canon stream.cancel-write $ST async (core func $stream.cancel-write))
349349
(canon stream.drop-readable $ST (core func $stream.drop-readable))
350350
(canon stream.drop-writable $ST (core func $stream.drop-writable))
351351
(canon future.new $FT (core func $future.new))
352-
(canon future.read $FT async (memory $memory "mem") (core func $future.read))
353-
(canon future.write $FT async (memory $memory "mem") (core func $future.write))
352+
(canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read))
353+
(canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write))
354354
(canon future.cancel-read $FT async (core func $future.cancel-read))
355355
(canon future.cancel-write $FT async (core func $future.cancel-write))
356356
(canon future.drop-readable $FT (core func $future.drop-readable))
357357
(canon future.drop-writable $FT (core func $future.drop-writable))
358358
(canon task.return (core func $task.return))
359359
(canon waitable.join (core func $waitable.join))
360360
(canon waitable-set.new (core func $waitable-set.new))
361-
(canon waitable-set.poll (memory $memory "mem") (core func $waitable-set.poll))
362-
(canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait))
361+
(canon waitable-set.poll (memory (core memory $memory "mem")) (core func $waitable-set.poll))
362+
(canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait))
363363
(canon waitable-set.drop (core func $waitable-set.drop))
364364
(canon subtask.cancel async (core func $subtask.cancel))
365365
(canon subtask.drop (core func $subtask.drop))
366-
(canon lower (func $sink) async (memory $memory "mem") (core func $sink'))
367-
(canon lower (func $sink-future) async (memory $memory "mem") (core func $sink-future'))
368-
(canon lower (func $block-empty) async (memory $memory "mem") (core func $block-empty'))
369-
(canon lower (func $block-future) async (memory $memory "mem") (core func $block-future'))
366+
(canon lower (func $sink) async (memory (core memory $memory "mem")) (core func $sink'))
367+
(canon lower (func $sink-future) async (memory (core memory $memory "mem")) (core func $sink-future'))
368+
(canon lower (func $block-empty) async (memory (core memory $memory "mem")) (core func $block-empty'))
369+
(canon lower (func $block-future) async (memory (core memory $memory "mem")) (core func $block-future'))
370370
(canon lower (func $bp-inc) (core func $bp-inc'))
371371
(canon lower (func $bp-dec) (core func $bp-dec'))
372372
(core instance $tm (instantiate $TM (with "" (instance
@@ -401,7 +401,7 @@
401401
(export "waitable-set.drop" (func $waitable-set.drop))))))
402402
(func (export "poll-readable") (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift (core func $tm "poll-readable")))
403403
(func (export "await-readable") async (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift
404-
(core func $tm "await-readable") async (memory $memory "mem")))
404+
(core func $tm "await-readable") async (memory (core memory $memory "mem"))))
405405
(func (export "call-import") (param "slot" u8) (result s32) (canon lift (core func $tm "call-import")))
406406
(func (export "call-import-future") (param "slot" u8) (result s32) (canon lift (core func $tm "call-import-future")))
407407
(func (export "call-block-empty") (param "sub" u8) (result s32) (canon lift (core func $tm "call-block-empty")))
@@ -411,7 +411,7 @@
411411
(func (export "mock-bp-inc") (canon lift (core func $tm "mock-bp-inc")))
412412
(func (export "mock-bp-dec") (canon lift (core func $tm "mock-bp-dec")))
413413
(func (export "await-subtask") async (param "sub" u8) (param "state" u8) (canon lift
414-
(core func $tm "await-subtask") async (memory $memory "mem")))
414+
(core func $tm "await-subtask") async (memory (core memory $memory "mem"))))
415415
(func (export "stream-new") (param "slot" u8) (canon lift (core func $tm "stream-new")))
416416
(func (export "testee-write") (param "handle" u8) (param "bytes" u32) (result s32) (canon lift (core func $tm "testee-write")))
417417
(func (export "testee-read") (param "handle" u8) (param "bytes" u32) (result s32) (canon lift (core func $tm "testee-read")))
@@ -428,7 +428,7 @@
428428
(func (export "drop-writable") (param "slot" u8) (canon lift (core func $tm "drop-writable")))
429429
(func (export "poll") (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift (core func $tm "poll")))
430430
(func (export "await") async (param "slot" u8) (param "event" u8) (param "payload" u32) (canon lift
431-
(core func $tm "await") async (memory $memory "mem")))
431+
(core func $tm "await") async (memory (core memory $memory "mem"))))
432432
)
433433

434434
(component $Driver
@@ -770,7 +770,7 @@
770770
(export "mock-bp-inc" (func $mock-bp-inc'))
771771
(export "mock-bp-dec" (func $mock-bp-dec'))))))
772772
(func (export "run") (param "prog" (list $command-e))
773-
(canon lift (core func $dm "run") (memory $dm "mem") (realloc (func $dm "realloc")))))
773+
(canon lift (core func $dm "run") (memory (core memory $dm "mem")) (realloc (core func $dm "realloc")))))
774774

775775
(instance $mock (instantiate $Mock))
776776
(instance $testee (instantiate $Testee

test/async/builtin-trap-poisons-instance.wast

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
)
2626
(type $ST (stream u8))
2727
(canon stream.new $ST (core func $stream.new))
28-
(canon stream.write $ST async (memory $memory "mem") (core func $stream.write))
28+
(canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write))
2929
(canon stream.drop-writable $ST (core func $stream.drop-writable))
3030
(core instance $m (instantiate $M (with "" (instance
3131
(export "mem" (memory $memory "mem"))

test/async/cancel-stream.wast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
(type $ST (stream u8))
7171
(canon task.return (result u32) (core func $task.return))
7272
(canon stream.new $ST (core func $stream.new))
73-
(canon stream.write $ST async (memory $memory "mem") (core func $stream.write))
73+
(canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write))
7474
(canon stream.cancel-write $ST (core func $stream.cancel-write))
7575
(canon stream.drop-writable $ST (core func $stream.drop-writable))
7676
(core instance $cm (instantiate $CM (with "" (instance
@@ -173,7 +173,7 @@
173173
)
174174
)
175175
(type $ST (stream u8))
176-
(canon stream.read $ST async (memory $memory "mem") (core func $stream.read))
176+
(canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read))
177177
(canon stream.cancel-read $ST (core func $stream.cancel-read))
178178
(canon stream.drop-readable $ST (core func $stream.drop-readable))
179179
(canon lower (func $c "start-stream") (core func $start-stream'))

test/async/cancel-subtask.wast

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@
5858
)
5959
(type $FT (future))
6060
(canon task.cancel (core func $task.cancel))
61-
(canon future.read $FT async (memory $memory "mem") (core func $future.read))
61+
(canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read))
6262
(canon waitable.join (core func $waitable.join))
6363
(canon waitable-set.new (core func $waitable-set.new))
64-
(canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait))
64+
(canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait))
6565
(core instance $cm (instantiate $CM (with "" (instance
6666
(export "mem" (memory $memory "mem"))
6767
(export "task.cancel" (func $task.cancel))
@@ -72,7 +72,7 @@
7272
))))
7373
(func (export "f") async (result u32) (canon lift
7474
(core func $cm "f")
75-
async (callback (func $cm "f_cb"))
75+
async (callback (core func $cm "f_cb"))
7676
))
7777
(func (export "g") async (param "fut" $FT) (result u32) (canon lift
7878
(core func $cm "g")
@@ -170,12 +170,12 @@
170170
(canon subtask.cancel async (core func $subtask.cancel))
171171
(canon subtask.drop (core func $subtask.drop))
172172
(canon future.new $FT (core func $future.new))
173-
(canon future.write $FT async (memory $memory "mem") (core func $future.write))
173+
(canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write))
174174
(canon waitable.join (core func $waitable.join))
175175
(canon waitable-set.new (core func $waitable-set.new))
176-
(canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait))
177-
(canon lower (func $f) async (memory $memory "mem") (core func $f'))
178-
(canon lower (func $g) async (memory $memory "mem") (core func $g'))
176+
(canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait))
177+
(canon lower (func $f) async (memory (core memory $memory "mem")) (core func $f'))
178+
(canon lower (func $g) async (memory (core memory $memory "mem")) (core func $g'))
179179
(core instance $dm (instantiate $DM (with "" (instance
180180
(export "mem" (memory $memory "mem"))
181181
(export "subtask.cancel" (func $subtask.cancel))

test/async/cancellable.wast

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@
102102
)
103103
(type $FT (future))
104104
(canon task.cancel (core func $task.cancel))
105-
(canon future.read $FT async (memory $memory "mem") (core func $future.read))
105+
(canon future.read $FT async (memory (core memory $memory "mem")) (core func $future.read))
106106
(canon waitable.join (core func $waitable.join))
107107
(canon waitable-set.new (core func $waitable-set.new))
108-
(canon waitable-set.wait cancellable (memory $memory "mem") (core func $waitable-set.wait-cancellable))
109-
(canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait))
110-
(canon waitable-set.poll cancellable (memory $memory "mem") (core func $waitable-set.poll-cancellable))
108+
(canon waitable-set.wait cancellable (memory (core memory $memory "mem")) (core func $waitable-set.wait-cancellable))
109+
(canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait))
110+
(canon waitable-set.poll cancellable (memory (core memory $memory "mem")) (core func $waitable-set.poll-cancellable))
111111
(canon thread.yield cancellable (core func $thread.yield-cancellable))
112112
(core instance $cm (instantiate $CM (with "" (instance
113113
(export "mem" (memory $memory "mem"))
@@ -122,19 +122,19 @@
122122
))))
123123
(func (export "wait-cancel") async (result u32) (canon lift
124124
(core func $cm "wait-cancel")
125-
async (callback (func $cm "unreachable-cb"))
125+
async (callback (core func $cm "unreachable-cb"))
126126
))
127127
(func (export "yield-cancel") async (result u32) (canon lift
128128
(core func $cm "yield-cancel")
129-
async (callback (func $cm "unreachable-cb"))
129+
async (callback (core func $cm "unreachable-cb"))
130130
))
131131
(func (export "poll-cancel-pending") async (param "fut" $FT) (result u32) (canon lift
132132
(core func $cm "poll-cancel-pending")
133-
async (callback (func $cm "unreachable-cb"))
133+
async (callback (core func $cm "unreachable-cb"))
134134
))
135135
(func (export "yield-cancel-pending") async (param "fut" $FT) (result u32) (canon lift
136136
(core func $cm "yield-cancel-pending")
137-
async (callback (func $cm "unreachable-cb"))
137+
async (callback (core func $cm "unreachable-cb"))
138138
))
139139
)
140140

@@ -288,14 +288,14 @@
288288
(canon subtask.cancel async (core func $subtask.cancel))
289289
(canon subtask.drop (core func $subtask.drop))
290290
(canon future.new $FT (core func $future.new))
291-
(canon future.write $FT async (memory $memory "mem") (core func $future.write))
291+
(canon future.write $FT async (memory (core memory $memory "mem")) (core func $future.write))
292292
(canon waitable.join (core func $waitable.join))
293293
(canon waitable-set.new (core func $waitable-set.new))
294-
(canon waitable-set.wait (memory $memory "mem") (core func $waitable-set.wait))
295-
(canon lower (func $wait-cancel) async (memory $memory "mem") (core func $wait-cancel'))
296-
(canon lower (func $yield-cancel) async (memory $memory "mem") (core func $yield-cancel'))
297-
(canon lower (func $poll-cancel-pending) async (memory $memory "mem") (core func $poll-cancel-pending'))
298-
(canon lower (func $yield-cancel-pending) async (memory $memory "mem") (core func $yield-cancel-pending'))
294+
(canon waitable-set.wait (memory (core memory $memory "mem")) (core func $waitable-set.wait))
295+
(canon lower (func $wait-cancel) async (memory (core memory $memory "mem")) (core func $wait-cancel'))
296+
(canon lower (func $yield-cancel) async (memory (core memory $memory "mem")) (core func $yield-cancel'))
297+
(canon lower (func $poll-cancel-pending) async (memory (core memory $memory "mem")) (core func $poll-cancel-pending'))
298+
(canon lower (func $yield-cancel-pending) async (memory (core memory $memory "mem")) (core func $yield-cancel-pending'))
299299
(core instance $dm (instantiate $DM (with "" (instance
300300
(export "mem" (memory $memory "mem"))
301301
(export "subtask.cancel" (func $subtask.cancel))

test/async/closed-stream.wast

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
)
3131
(type $ST (stream u8))
3232
(canon stream.new $ST (core func $stream.new))
33-
(canon stream.write $ST async (memory $memory "mem") (core func $stream.write))
33+
(canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write))
3434
(canon stream.drop-writable $ST (core func $stream.drop-writable))
3535
(core instance $cm (instantiate $CM (with "" (instance
3636
(export "mem" (memory $memory "mem"))
@@ -77,8 +77,8 @@
7777
)
7878
(type $ST (stream u8))
7979
(canon stream.new $ST (core func $stream.new))
80-
(canon stream.read $ST async (memory $memory "mem") (core func $stream.read))
81-
(canon stream.write $ST async (memory $memory "mem") (core func $stream.write))
80+
(canon stream.read $ST async (memory (core memory $memory "mem")) (core func $stream.read))
81+
(canon stream.write $ST async (memory (core memory $memory "mem")) (core func $stream.write))
8282
(canon stream.drop-writable $ST (core func $stream.drop-writable))
8383
(canon lower (func $c "start-stream") (core func $start-stream'))
8484
(canon lower (func $c "drop-writable") (core func $drop-writable'))

0 commit comments

Comments
 (0)