summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* [wasm-objdump] Print i64 values as unsigned (#2344)Rod Vagg2023-12-011-4/+4
| | | | | This matches the behaviour of i32 printing. Ref: https://github.com/WebAssembly/wabt/pull/2342
* wasm2c: Test STDIN_FILE error output line numbers (#2341)Soni L2023-11-292-0/+14
|
* Add support for new WASM_SYMBOL_ABS symbol flag (#2305)Sam Clegg2023-11-281-4/+12
| | | See https://github.com/llvm/llvm-project/pull/67493
* Make run-spec-wasm2c platform-consistent (#2335)Soni L2023-11-286-69/+8
|
* Update ID for tag name subsection (#2336)Michael Williamson2023-11-271-1/+1
| | | | | | | The tag name subsection currently has the speculative ID of 10. However, the extended-name-section proposal has now been updated to use an ID of 11 for the tag name section. This updates the NameSectionSubsection enum accordingly, as well as adding a field name section with the ID of 10.
* wasm2c: Fix f64 harness (#2331)Soni L2023-11-203-1/+49
|
* decompiler.cc: fix vector oob when if has empty then (#2334)Hyxogen2023-11-201-0/+5
|
* wasm2c: Improve address abstraction for BE support (#2328)Soni L2023-11-146-312/+270
|
* wasm2c: Fix test harness UB with SIMD (#2327)Soni L2023-11-126-4/+63
|
* Clean up WABT_BIG_ENDIAN handling in tests (#2326)Soni L2023-11-121-6/+1
|
* Update testsuite (#2287)Keith Winstein2023-10-2418-607/+364
|
* wasm2c: implement the tail-call proposal (#2272)Keith Winstein2023-10-2410-22/+1120
|
* feat: treat non-seekable files as pipes (#2309)sethp2023-10-023-1/+11
| | | | | | | | | | | | | | | Previously, attempting to read from a pipe would result in an error: 'not a regular file', disallowing use of files like /dev/stdin or /dev/fd/3, named fifos, sockets, etc. The tools already understand how to (try to) read from non-regular files, so this change attempts to do so when the input is not seek-able (the "regular file" capability that's in use here). Additionally, this adds a test for the new behavior using a bash herestring and process substitution (the latter of which shows up in argv as something like `/dev/fd/NN`). Since bash isn't commonly installed on Windows, this change also introduces a new capability to filter tests to specific platforms (sorry).
* Rename wasm-opcodecnt to wasm-stats (#2298)Soni L2023-09-197-18/+17
|
* Implement custom section reading/writing (#2284)Diego Frias2023-09-155-3/+40
|
* [wasm2c] Use wasm_rt_memcpy everywhere in generated code (#2292)Sam Clegg2023-09-095-75/+75
|
* [wasm2c] Add '-Wno-array-bounds' when building wasm2c output (#2293)Sam Clegg2023-09-081-0/+1
| | | | | | We are seeing some (spurious?) warning from gcc 12.2. I've been seeing them locally, but they started to show up in CI as part of #2292.
* Share reading/validation code between elem exprs & other const exprs (#2288)Keith Winstein2023-09-0622-73/+164
| | | | | | This continues the work from #1783 and reduces special handling of elem exprs, by treating them the same as other const expressions (init expressions).
* Validator: normalize handling of Select in ExprVisitor Delegate (#2285)Keith Winstein2023-08-233-9/+0
| | | | | | | | | Fixes #2283 Previously, the OnSelectExpr delegate would terminate validation if the SharedValidator found an error in the expression, or if the Validator had previously found an error at any point in validating the module. This commit normalizes the behavior to match how the Validator handles other expression types.
* wasm-strip: add `-R/--remove-section` option (#2282)Diego Frias2023-08-181-0/+36
|
* wat-writer.cc: resolve missing type index in call_indirect (#2278)Keith Winstein2023-07-311-0/+24
|
* c-writer.cc: clean up handling of functions & tags (NFC) (#2271)Keith Winstein2023-07-313-11/+11
|
* decompiler.cc: passive data segments do not have offsets (#2163)mannkdev2023-07-301-0/+9
|
* wasm2c: add link to clang bug on mips force read constraintShravan Narayan2023-07-305-0/+5
|
* wasm2c: ensure force read constraints compile for clang on mipsShravan Narayan2023-07-305-100/+140
|
* wasm-objdump: Fix local numbering in disassembly (#2265)Michael Williamson2023-06-272-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, in BinaryReaderObjdumpDisassemble::BeginFunctionBody, we had: local_index_ = objdump_state_->function_param_counts[index]; where index is the index of the function i.e. we treat the keys of function_param_counts as function indices. However, function_param_counts is populated in OnFuncType with: objdump_state_->function_param_counts[index] = param_count; where index is the index of the type i.e. we treat the keys of function_param_counts as type indices. This discrepancy would cause the locals to be incorrectly numbered in the "Code Disassembly" section. This fixes the discrepancy by adding a new field, function_types, which maps from function indices to type indices, and is populated in BinaryReaderObjdump::OnFunction. This field is used in BinaryReaderObjdumpDisassemble::BeginFunctionBody to get the type index for the given function, which is then used to get the parameter count. Fixes #2264.
* BinaryReader/Writer: roundtrip large memory64 offsets (#2255)Keith Winstein2023-06-202-6/+19
| | | With memory64, the offset becomes a u64.
* memory64: when enabled, check offset range at validation-time (#2253)Keith Winstein2023-06-127-28/+50
| | | | | | | | | | | | | | | | * memory64: when enabled, offset range check is at validation-time Before memory64, the "offset" in a load/store expression was a u32, and we enforced this in the WastParser and BinaryReader. After memory64, the "offset" becomes a u64 syntactically, and the validator checks that it's <= UINT32_MAX for i32 memories. We hadn't been correctly allowing these very large offsets in the text format (even when memory64 was enabled and the memory was i64). (This change also eliminates the "memories" member in the BinaryReader. The BinaryReader no longer needs to keep track of the memories and their types to check well-formedness.)
* spectest-interp: assert_malformed must error in reader alone (#2252)Keith Winstein2023-06-124-8/+4
| | | | | | Previously assert_malformed was treated the same as assert_invalid Also fixes a bug where spectest-interp wasn't trying to validate text modules (e.g. `(assert_invalid (module quote "...") "")`).
* src/leb128.cc: fix detection of too-big u64 LEB128s (#2256)Keith Winstein2023-06-091-0/+29
|
* Add error when parameter size does not match on wasm-interp run-export (#2250)Raphael Amorim2023-06-091-0/+9
|
* binary-reader.cc: detect more malformed modules (#2251)Keith Winstein2023-06-084-11/+6
|
* WastParser: allow empty modules/scripts with warning (#2248)Keith Winstein2023-06-072-3/+2
|
* WastParser::ErrorExpected: ensure there is a token to consume (#2247)Keith Winstein2023-06-071-0/+6
| | | Fixes assertion failure on empty quoted module
* wasm2c: partial support for atomic memory opsShravan Narayan2023-05-173-1/+547
|
* wasm2c: include simd128.h and wasm-rt-exceptions.h where necessary (#2236)Keith Winstein2023-05-125-680/+5
| | | Co-authored-by: Shravan Narayan <shravanrn@gmail.com>
* wasm2c: Fix typo in testing harness (#2234)Shravan Narayan2023-05-111-1/+1
|
* c-writer.cc: Correctly handle label names when branching out of try block ↵Keith Winstein2023-05-081-0/+12
| | | | (#2208)
* Track use of SIMD and exceptions in IR, and CWriter includes support only if ↵Keith Winstein2023-05-085-10/+0
| | | | used (#2226)
* wasm2c: update simde submodule to 0.7.4-rc4 and add remaining tests (#2225)Keith Winstein2023-05-045-0/+25
|
* BinaryReader/BinaryReaderIR: check for missing end markers (#2218)Keith Winstein2023-05-034-3/+14
|
* wasm2c: Enable exceptions and simd according to command line flagsShravan Narayan2023-05-027-3/+36
|
* alloca() lives in <stdlib.h> on OpenBSD too (fixes #2216) (#2217)Landry Breuil2023-04-265-5/+5
| | | per http://man.openbsd.org/alloca.3
* wasm2c: Use malloc.h instead of alloca.h for mingwShravan Narayan2023-04-245-5/+15
|
* wasm2c.includes.c: replace alloca.h with stdlib.h on FreeBSD (#2212)Petr Penzin2023-04-225-0/+10
|
* wasm2c exception handling: fix unwinding after br inside try (#2204)Soni L2023-04-211-0/+28
|
* wasm-objdump: Include function names in "init functions" subsection (#2202)Sam Clegg2023-04-201-2/+2
|
* wasm2c: Separate the macros for allocation and bounds checks strategiesShravan Narayan2023-04-125-5/+5
|
* wasm2c: expose the initial and max size required from imported tablesShravan Narayan2023-04-112-4/+921
|
* wasm2c: multiple .c outputs (#2146)Yuhan Deng2023-04-059-43/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * wasm2c: multiple .c outputs This enables wasm2c to have multiple .c outputs, which allows parallel compilation of the wasm2c outputs. This is useful when the input WASM module is big. wasm2c takes the number of .c outputs as an argument to `--num-outputs` (defaulting to 1). If the number is equal to 1, the .c output does not change except for two new macro declarations and the ordering of declarations and definitions. If greater than 1, wasm2c outputs change in the following ways: 1) wasm2c outputs a [module-name]-impl.h that includes any module-wide declarations, including: * content of `WriteSourceTop()` * function type declarations * tag types * tag declarations * function declarations * data segments and elem segments declarations Any static declaration become extern in this header. 2) wasm2c outputs [module-name]_i.c for i = [0, ..., number of .c outputs - 1). Any module-wide material is written to [module-name]_0.c, including: * function types, tags, data segments, elem segments * imports and exports * module initialization, instantiation and free 3) For each function implementation, wasm2c assigns it to one output .c file by sorting the function names and partitioning into roughly equal buckets. Alternately, the caller can supply its own assignment function (helpful if it wants the assignments to be more stable in the face of function insertion or deletion).