Skip to content

Commit c24adde

Browse files
committed
Add test for EM_JS and i64 arguments
Ideally we should error out if WASM_BIGINT is not passed by I have yet to find a good place to do that. See #15871
1 parent a6721f6 commit c24adde

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

tests/core/test_em_js_i64.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#include <stdint.h>
2+
#include <emscripten.h>
3+
4+
EM_JS(void, foo, (uint64_t a, int64_t b), {
5+
console.log('a:' + a);
6+
console.log('b:' + b);
7+
})
8+
9+
int main() {
10+
foo(42000000000ull, -42ll);
11+
}

tests/core/test_em_js_i64.out

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
a:42000000000
2+
b:-42

tests/test_core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2142,6 +2142,11 @@ def test_em_js(self, args, force_c):
21422142
self.do_core_test('test_em_js.cpp', force_c=force_c)
21432143
self.assertContained("no args returning int", read_file('test_em_js.js'))
21442144

2145+
def test_em_js_i64(self):
2146+
self.set_setting('WASM_BIGINT')
2147+
self.node_args += ['--experimental-wasm-bigint']
2148+
self.do_core_test('test_em_js_i64.c')
2149+
21452150
def test_runtime_stacksave(self):
21462151
self.do_runf(test_file('core/test_runtime_stacksave.c'), 'success')
21472152

0 commit comments

Comments
 (0)