diff --git a/tests/test_core.py b/tests/test_core.py index 7eb98a6e2962a..225fd53c43b5d 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -7135,8 +7135,8 @@ def test_binaryen_trap_mode(self): print(' f2i') self.do_run(open(path_from_root('tests', 'wasm', 'trap-f2i.cpp')).read(), { - 'js': '|1337|', # JS did an fmod 2^32 - 'clamp': '|-2147483648|', + 'js': '|1337|\n|4294967295|', # JS did an fmod 2^32 | normal + 'clamp': '|-2147483648|\n|4294967295|', 'allow': TRAP_OUTPUTS }[mode]) diff --git a/tests/wasm/trap-f2i.cpp b/tests/wasm/trap-f2i.cpp index e587f33bb80ab..95c6d86369b00 100644 --- a/tests/wasm/trap-f2i.cpp +++ b/tests/wasm/trap-f2i.cpp @@ -1,9 +1,18 @@ #include int main() { - volatile double d = 17179870521; - EM_ASM({ - Module.print('|' + $0 + '|') - }, int(d)); + { + volatile double d = 17179870521; + EM_ASM({ + Module.print('|' + $0 + '|') + }, int(d)); + } + { + // unsigned + volatile double d = 4294967295.0; + EM_ASM({ + Module.print('|' + ($0 >>> 0) + '|') + }, unsigned(d)); + } }