summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-04-14 07:58:11 +0000
committerGitHub <noreply@github.com>2022-04-14 00:58:11 -0700
commit67c7490aea420a98bd90005cffd7544b804530a0 (patch)
treed920ff346577d01891263d2e8ba672af901d923a /test
parent39022f8cd717ec5f219c56f4ebd07f016c457afc (diff)
downloadwabt-67c7490aea420a98bd90005cffd7544b804530a0.tar.gz
wabt-67c7490aea420a98bd90005cffd7544b804530a0.tar.bz2
wabt-67c7490aea420a98bd90005cffd7544b804530a0.zip
Remove signature mangling from wasm2c output (#1896)
This effectively means that we no longer support imports that are overloaded by signature only. This is not something that we need to support in order to support the core wasm spec. This feature is available in the JS embedding but there is no good reason (AFAICT) to support it in wasm2c, and this simplifies the generated code. Fixes #1858
Diffstat (limited to 'test')
-rwxr-xr-xtest/run-spec-wasm2c.py15
-rw-r--r--test/spec-wasm2c-prefix.c18
2 files changed, 9 insertions, 24 deletions
diff --git a/test/run-spec-wasm2c.py b/test/run-spec-wasm2c.py
index 7ecdc5f8..3e7f7574 100755
--- a/test/run-spec-wasm2c.py
+++ b/test/run-spec-wasm2c.py
@@ -311,24 +311,11 @@ class CWriter(object):
def _CompareList(self, consts):
return ' && '.join(self._Compare(num, const) for num, const in enumerate(consts))
- def _ActionSig(self, action, expected):
- type_ = action['type']
- result_types = [result['type'] for result in expected]
- arg_types = [arg['type'] for arg in action.get('args', [])]
- if type_ == 'invoke':
- return MangleTypes(result_types) + MangleTypes(arg_types)
- elif type_ == 'get':
- return MangleType(result_types[0])
- else:
- raise Error('Unexpected action type: %s' % type_)
-
def _Action(self, command):
action = command['action']
- expected = command['expected']
type_ = action['type']
mangled_module_name = self.GetModulePrefix(action.get('module'))
- field = (mangled_module_name + MangleName(action['field']) +
- MangleName(self._ActionSig(action, expected)))
+ field = mangled_module_name + MangleName(action['field'])
if type_ == 'invoke':
return '%s(%s)' % (field, self._ConstantList(action.get('args', [])))
elif type_ == 'get':
diff --git a/test/spec-wasm2c-prefix.c b/test/spec-wasm2c-prefix.c
index bad8f647..4415be6f 100644
--- a/test/spec-wasm2c-prefix.c
+++ b/test/spec-wasm2c-prefix.c
@@ -235,18 +235,16 @@ static wasm_rt_memory_t spectest_memory;
static uint32_t spectest_global_i32 = 666;
static uint64_t spectest_global_i64 = 666l;
-void (*Z_spectestZ_printZ_vv)(void) = &spectest_print;
-void (*Z_spectestZ_print_i32Z_vi)(uint32_t) = &spectest_print_i32;
-void (*Z_spectestZ_print_f32Z_vf)(float) = &spectest_print_f32;
-void (*Z_spectestZ_print_i32_f32Z_vif)(uint32_t,
- float) = &spectest_print_i32_f32;
-void (*Z_spectestZ_print_f64Z_vd)(double) = &spectest_print_f64;
-void (*Z_spectestZ_print_f64_f64Z_vdd)(double,
- double) = &spectest_print_f64_f64;
+void (*Z_spectestZ_print)(void) = &spectest_print;
+void (*Z_spectestZ_print_i32)(uint32_t) = &spectest_print_i32;
+void (*Z_spectestZ_print_f32)(float) = &spectest_print_f32;
+void (*Z_spectestZ_print_i32_f32)(uint32_t, float) = &spectest_print_i32_f32;
+void (*Z_spectestZ_print_f64)(double) = &spectest_print_f64;
+void (*Z_spectestZ_print_f64_f64)(double, double) = &spectest_print_f64_f64;
wasm_rt_table_t* Z_spectestZ_table = &spectest_table;
wasm_rt_memory_t* Z_spectestZ_memory = &spectest_memory;
-uint32_t* Z_spectestZ_global_i32Z_i = &spectest_global_i32;
-uint64_t* Z_spectestZ_global_i64Z_j = &spectest_global_i64;
+uint32_t* Z_spectestZ_global_i32 = &spectest_global_i32;
+uint64_t* Z_spectestZ_global_i64 = &spectest_global_i64;
static void init_spectest_module(void) {
wasm_rt_allocate_memory(&spectest_memory, 1, 2);