summaryrefslogtreecommitdiff
path: root/test/unit/test_features.py
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-12-12 14:00:04 -0800
committerGitHub <noreply@github.com>2023-12-12 14:00:04 -0800
commita6c1165db639e505d68758b14256492ede57e362 (patch)
tree5ca315b2f39dad8a36ebeceb9f8b1deebc9f16e3 /test/unit/test_features.py
parenta2a59e96f8f18e00e8aea9627d3b15d894d5a825 (diff)
downloadbinaryen-a6c1165db639e505d68758b14256492ede57e362.tar.gz
binaryen-a6c1165db639e505d68758b14256492ede57e362.tar.bz2
binaryen-a6c1165db639e505d68758b14256492ede57e362.zip
Add a `tuple.drop` text pseudoinstruction (#6170)
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.
Diffstat (limited to 'test/unit/test_features.py')
-rw-r--r--test/unit/test_features.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/test_features.py b/test/unit/test_features.py
index 8e38a04f8..2c596a542 100644
--- a/test/unit/test_features.py
+++ b/test/unit/test_features.py
@@ -235,7 +235,7 @@ class FeatureValidationTest(utils.BinaryenTestCase):
module = '''
(module
(func $foo
- (drop
+ (tuple.drop 2
(block (result i32 i64)
(tuple.make 2
(i32.const 42)