summaryrefslogtreecommitdiff
path: root/auto_update_tests.py
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-01-11 13:29:10 -0800
committerGitHub <noreply@github.com>2022-01-11 13:29:10 -0800
commitcc36ffd13f6794cc5212a1f0ba7f58e816e8a0de (patch)
tree48557d4f56f512d2a07f82c4b27a28f052d2eff7 /auto_update_tests.py
parent1e7e248d890d27a40f3dc287bd82834930f81e5c (diff)
downloadbinaryen-cc36ffd13f6794cc5212a1f0ba7f58e816e8a0de.tar.gz
binaryen-cc36ffd13f6794cc5212a1f0ba7f58e816e8a0de.tar.bz2
binaryen-cc36ffd13f6794cc5212a1f0ba7f58e816e8a0de.zip
[ctor-eval] Add an option to keep some exports (#4441)
By default wasm-ctor-eval removes exports that it manages to completely eval (if it just partially evals then the export remains, but points to a function with partially-evalled contents). However, in some cases we do want to keep the export around even so, for example during fuzzing (as the fuzzer wants to call the same exports before and after wasm-ctor-eval runs) and also if there is an ABI we need to preserve (like if we manage to eval all of main()), or if the function returns a value (which we don't support yet, but this is a PR to prepare for that). Specifically, there is now a new option: --kept-exports foo,bar That is a list of exports to keep around. Note that when we keep around an export after evalling the ctor we make the export point to a new function. That new function just contains a nop, so that nothing happens when it is called. But the original function is kept around as it may have other callers, who we do not want to modify.
Diffstat (limited to 'auto_update_tests.py')
-rwxr-xr-xauto_update_tests.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/auto_update_tests.py b/auto_update_tests.py
index 9f93142a8..7277f5e77 100755
--- a/auto_update_tests.py
+++ b/auto_update_tests.py
@@ -89,6 +89,8 @@ def update_ctor_eval_tests():
cmd = shared.WASM_CTOR_EVAL + [t, '-all', '-o', 'a.wast', '-S', '--ctors', ctors]
if 'ignore-external-input' in t:
cmd += ['--ignore-external-input']
+ if 'results' in t:
+ cmd += ['--kept-exports', 'test1,test3']
support.run_command(cmd)
actual = open('a.wast').read()
out = t + '.out'