diff options
author | Daniel Wirtz <dcode@dcode.io> | 2020-09-19 08:48:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-19 08:48:06 +0200 |
commit | e35cdb97adf6eb2ade2be7734d1c6c397d440dc1 (patch) | |
tree | 7a740e6fc54d286a05ca3e746ae1e7f3c4b783a8 /test/unit | |
parent | e308db569ab2582d3b0ea9accdbaa3b27abdb044 (diff) | |
download | binaryen-e35cdb97adf6eb2ade2be7734d1c6c397d440dc1.tar.gz binaryen-e35cdb97adf6eb2ade2be7734d1c6c397d440dc1.tar.bz2 binaryen-e35cdb97adf6eb2ade2be7734d1c6c397d440dc1.zip |
GC: Integrate eqref and i31ref types (#3141)
Adds the `eqref` and `i31ref` types to their respective code locations. Implements what can be implemented trivially and otherwise traps with a TODO for now. Integration of `eqref` is mostly complete due to it being nullable, just like `anyref`, but `i31ref` needs to remain disabled in the fuzzer because we are lacking the functionality to create trivial `i31ref` values, i.e. `(i31.new (i32.const 0))`, which is left for follow-ups to implement.
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/input/gc_target_feature.wasm | bin | 56 -> 61 bytes | |||
-rw-r--r-- | test/unit/test_features.py | 22 |
2 files changed, 21 insertions, 1 deletions
diff --git a/test/unit/input/gc_target_feature.wasm b/test/unit/input/gc_target_feature.wasm Binary files differindex cd094ca3a..ccabbc16e 100644 --- a/test/unit/input/gc_target_feature.wasm +++ b/test/unit/input/gc_target_feature.wasm diff --git a/test/unit/test_features.py b/test/unit/test_features.py index 4a82f8cc2..a44d58bbd 100644 --- a/test/unit/test_features.py +++ b/test/unit/test_features.py @@ -276,6 +276,24 @@ class FeatureValidationTest(utils.BinaryenTestCase): ''' self.check_gc(module, 'all used types should be allowed') + def test_eqref_global(self): + module = ''' + (module + (global $foo eqref (ref.null eq)) + ) + ''' + self.check_gc(module, 'all used types should be allowed') + + def test_eqref_local(self): + module = ''' + (module + (func $foo + (local $0 eqref) + ) + ) + ''' + self.check_gc(module, 'all used types should be allowed') + class TargetFeaturesSectionTest(utils.BinaryenTestCase): def test_atomics(self): @@ -337,7 +355,9 @@ class TargetFeaturesSectionTest(utils.BinaryenTestCase): filename = 'gc_target_feature.wasm' self.roundtrip(filename) self.check_features(filename, ['reference-types', 'gc']) - self.assertIn('anyref', self.disassemble(filename)) + disassembly = self.disassemble(filename) + self.assertIn('anyref', disassembly) + self.assertIn('eqref', disassembly) def test_incompatible_features(self): path = self.input_path('signext_target_feature.wasm') |