diff options
author | Alon Zakai <azakai@google.com> | 2022-10-06 11:30:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-06 18:30:27 +0000 |
commit | e8884de3c880a7de4bb1f8eae3df5f00f4164b4d (patch) | |
tree | fc5ab515e8e969c20b64dc9b4df54645fd4a7e4d /test/unit/test_web_limitations.py | |
parent | e6be381b6f5adbd07af080a4e1f74ba04c8eda82 (diff) | |
download | binaryen-e8884de3c880a7de4bb1f8eae3df5f00f4164b4d.tar.gz binaryen-e8884de3c880a7de4bb1f8eae3df5f00f4164b4d.tar.bz2 binaryen-e8884de3c880a7de4bb1f8eae3df5f00f4164b4d.zip |
Warn on too many parameters for Web VMs (#5119)
Fixes emscripten-core/emscripten#17988
Diffstat (limited to 'test/unit/test_web_limitations.py')
-rw-r--r-- | test/unit/test_web_limitations.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/unit/test_web_limitations.py b/test/unit/test_web_limitations.py new file mode 100644 index 000000000..6359390f9 --- /dev/null +++ b/test/unit/test_web_limitations.py @@ -0,0 +1,22 @@ +import os + +from scripts.test import shared +from . import utils + + +class WebLimitations(utils.BinaryenTestCase): + def test_many_params(self): + """Test that we warn on large numbers of parameters, which Web VMs + disallow.""" + + params = '(param i32) ' * 1001 + module = ''' + (module + (func $foo %s + ) + ) + ''' % params + p = shared.run_process(shared.WASM_OPT + ['-o', os.devnull], + input=module, capture_output=True) + self.assertIn('Some VMs may not accept this binary because it has a large number of parameters in function foo.', + p.stderr) |