diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-09-11 13:34:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 13:34:01 -0700 |
commit | 8ec8a0bbfb039852b60f121fb23c439228b9fe36 (patch) | |
tree | 7987dcb2af2141dfc709cc8b761a69fd14f79798 /test/unit | |
parent | dbff242b3bc1fdaec15140cc48a537d7a497fb48 (diff) | |
download | binaryen-8ec8a0bbfb039852b60f121fb23c439228b9fe36.tar.gz binaryen-8ec8a0bbfb039852b60f121fb23c439228b9fe36.tar.bz2 binaryen-8ec8a0bbfb039852b60f121fb23c439228b9fe36.zip |
Update Pop text format to handle tuples (#3116)
Previously Pops were printed as ({type}.pop), and if the popped type was a
tuple, something like ((i32, i64).pop) would get printed. However, the parser
didn't support pops of anything besides single basic types.
This PR changes the text format to be (pop <type>*) and adds support for parsing
pops of tuples of basic types. The text format change is designed to make
parsing simpler. This change is necessary for writing Poppy IR tests (see #3059)
that contain break or return instructions that consume multiple values, since in
Poppy IR that requires tuple-typed pops.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/test_poppy_validation.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/unit/test_poppy_validation.py b/test/unit/test_poppy_validation.py index 3dc2907d8..6f868da2a 100644 --- a/test/unit/test_poppy_validation.py +++ b/test/unit/test_poppy_validation.py @@ -26,7 +26,7 @@ class PoppyValidationTest(utils.BinaryenTestCase): (func $foo (result i32) (block (result i32) (i32.const 0) - (i32.pop) + (pop i32) ) ) ) @@ -52,8 +52,8 @@ class PoppyValidationTest(utils.BinaryenTestCase): (f32.const 42) (i32.const 42) (i32.add - (i32.pop) - (i32.pop) + (pop i32) + (pop i32) ) ) ) @@ -68,8 +68,8 @@ class PoppyValidationTest(utils.BinaryenTestCase): (i32.const 42) (i32.const 42) (i32.add - (i32.pop) - (f32.pop) + (pop i32) + (pop f32) ) ) ) @@ -83,8 +83,8 @@ class PoppyValidationTest(utils.BinaryenTestCase): (i32.const 42) (i32.const 42) (i32.add - (i32.pop) - (i32.pop) + (pop i32) + (pop i32) ) ) ) @@ -134,7 +134,7 @@ class PoppyValidationTest(utils.BinaryenTestCase): (nop) (i32.const 1) (if - (i32.pop) + (pop i32) (nop) ) ) @@ -149,7 +149,7 @@ class PoppyValidationTest(utils.BinaryenTestCase): (nop) (i32.const 1) (if - (i32.pop) + (pop i32) (block) (nop) ) @@ -165,7 +165,7 @@ class PoppyValidationTest(utils.BinaryenTestCase): (nop) (i32.const 1) (if - (i32.pop) + (pop i32) (block) (block) ) @@ -194,7 +194,7 @@ class PoppyValidationTest(utils.BinaryenTestCase): (i32.const 42) (i32.const 5) (i32.add - (i32.pop) + (pop i32) (i32.const -1) ) ) |