summaryrefslogtreecommitdiff
path: root/test/lit/basic
Commit message (Collapse)AuthorAgeFilesLines
...
* [EH][test] Slice test code into different functions (#6177)Heejin Ahn2023-12-131-626/+767
| | | | | | | We ported basic tests to `test/lit/basic/` in #6160, but comparing `CHECK` lines with the test code for long functions is not easy, even though it wouldn't necessarily be worse than the the separate files we used to have in `test/`. This slices `exception-handling.wast` into functions so that the `CHECK` lines are easy to check.
* [test] Port tests in test/ to test/lit/basic/ (#6160)Heejin Ahn2023-12-1341-0/+23378
| | | | | | | | | | | | | | | | | | | | | This ports all tests from `test/` to `test/lit/basic/`. The set of commands and `CHECK` lines used are the same as the ones in #6159. Now we use `lit` to test these, this also deletes all `.wast`, `.wast.from-wast`, `.wast.fromBinary`, and `.wast.fromBinary.noDebugInfo` files from `test/` and all related test routines from the python scripts. All `CHECK` lines are generated by `update_lit_checks.py --all-items`. This also deletes these three multi-memory tests in `test/lit/`, because they seem to contain the same code with the ones in `test/`, which have been ported to `test/lit/basic/` along with other tests. - `test/lit/multi-memories-atomics64.wast` - `test/lit/multi-memories-basics.wast` - `test/lit/multi-memories-simd.wast` This also adds newlines between `(func`s in case there are none to make `CHECK` lines easy to view, and removes some extra existing newlines here and there.
* Add an arity immediate to tuple.extract (#6172)Thomas Lively2023-12-121-6/+6
| | | | | | | | Once support for tuple.extract lands in the new WAT parser, this arity immediate will let the parser determine how many values it should pop off the stack to serve as the tuple operand to `tuple.extract`. This will usually coincide with the arity of a tuple-producing instruction on top of the stack, but in the spirit of treating the input as a proper stack machine, it will not have to and the parser will still work correctly.
* Add a `tuple.drop` text pseudoinstruction (#6170)Thomas Lively2023-12-121-2/+2
| | | | | | | | | | | | | | | | | We previously overloaded `drop` to mean both normal drops of single values and also drops of tuple values. That works fine in the legacy text parser since it can infer parent-child relationships directly from the s-expression structure of the input, so it knows that a drop should drop an entire tuple if the tuple-producing instruction is a child of the drop. The new text parser, however, is much more like the binary parser in that it uses instruction types to create parent-child instructions. The new parser always assumes that `drop` is meant to drop just a single value because that's what it does in WebAssembly. Since we want to continue to let `Drop` IR expressions consume tuples, and since we will need a way to write tests for that IR pattern that work with the new parser, introduce a new pseudoinstruction, `tuple.drop`, to represent drops of tuples. This pseudoinstruction only exists in the text format and it parses to normal `Drop` expressions. `tuple.drop` takes the arity of its operand as an immediate, which will let the new parser parse it correctly in the future.
* [test] Tweak RUN commands of test/lit/basic/ (#6159)Heejin Ahn2023-12-114-793/+785
| | | | | | | | | | | | | | | | | | | | | | | This tweaks generated file names and `filecheck` prefixes to be more (IMHO) consistent. Also shortened binary/BINARY to bin/BIN for conciseness. This also changes the order of `RUN` commands a little. And this changes ```console wasm-opt %t.wast -all -o %t.text.wast -g -S ``` to ```console wasm-opt %s -all -o %t.text.wast -g -S ``` The current command doesn't take the source file but the generated file from the command above `wasm-dis`, which is not the behavior of `check.py`. This changes it back to the original source (`%s`). As a result of `wasm-opt` change, some tests are now failing because of the order of `(type)`s. So I just deleted all `CHECK` lines and regenerated them using `update_lit_checks.py --all-items`. The large amount of `CHECK` line changes are mainly because I moved `CHECK-TEXT` before `CHECK-BINARY` and not meaningful.
* [test] Move basic tests in lit/ to lit/basic/ (#6156)Heejin Ahn2023-12-084-0/+1411
Here 'basic' tests means that what we have in `binaryen/test/`. We checked three things with those tests: - Run `wasm-opt -all -g` on it and compare the output with `*.from-wast` - Run `wasm-as -all -g` and `wasm-dis` on it and compare the output with `*.fromBinary`. - Run `wasm-as -all` and `wasm-dis` on it and compare the output with `*.fromBinary.noDebugInfo`. I planned to move those to `test/lit/`. But `test/lit/` has other kind of tests as well, so I think it'd be nice to have a dedicated directory for these tests. Before doing that, I noticed there are already four tests that have been already ported to do this, and this PR moves them to `test/lit/basic/`. I couldn't come up with a better name than `basic`. If you have other suggestions please let me know.