|
7 | 7 | from subprocess import PIPE |
8 | 8 |
|
9 | 9 | from common import RunnerCore, create_file, read_file, test_file |
10 | | -from decorators import parameterized |
| 10 | +from decorators import also_with_wasm64, also_without_bigint, parameterized |
11 | 11 |
|
12 | 12 | from tools.shared import EMCC |
13 | 13 | from tools.utils import delete_file |
@@ -286,8 +286,27 @@ def test_jslib_invalid_decorator(self): |
286 | 286 | err = self.expect_fail([EMCC, test_file('hello_world.c'), '--js-library', 'lib.js']) |
287 | 287 | self.assertContained("lib.js: Decorator (jslibfunc__async} has wrong type. Expected 'boolean' not 'string'", err) |
288 | 288 |
|
| 289 | + @also_with_wasm64 |
| 290 | + @also_without_bigint |
289 | 291 | def test_jslib_i53abi(self): |
290 | 292 | create_file('lib.js', r''' |
| 293 | +mergeInto(LibraryManager.library, { |
| 294 | + jslibfunc__i53abi: true, |
| 295 | + jslibfunc__sig: 'j', |
| 296 | + jslibfunc: (x) => { return 42 }, |
| 297 | +}); |
| 298 | +''') |
| 299 | + create_file('test.c', r''' |
| 300 | +#include <stdio.h> |
| 301 | +int64_t jslibfunc(); |
| 302 | +int main() { |
| 303 | + printf("main: %lld\n", jslibfunc()); |
| 304 | +} |
| 305 | +''') |
| 306 | + self.do_runf('test.c', 'main: 42\n', cflags=['--js-library', 'lib.js']) |
| 307 | + |
| 308 | + def test_jslib_i53abi_errors(self): |
| 309 | + create_file('lib.js', r''' |
291 | 310 | mergeInto(LibraryManager.library, { |
292 | 311 | jslibfunc__i53abi: true, |
293 | 312 | jslibfunc: (x) => { return 42 }, |
|
0 commit comments