mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-08-17 09:20:28 +03:00
Meta: Generate bigints for i64 values in LibWasm test suite files
This commit is contained in:
parent
99199b9bfd
commit
e93c740df5
Notes:
sideshowbarker
2024-07-18 05:03:59 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/e93c740df5f Pull-request: https://github.com/SerenityOS/serenity/pull/9685
@ -245,7 +245,10 @@ def genarg(spec):
|
||||
return str(struct.unpack('>i', struct.pack('>Q', int(x, 16))[4:])[0])
|
||||
|
||||
# cast back to i64 to get the correct sign
|
||||
return str(struct.unpack('>q', struct.pack('>Q', int(x, 16)))[0])
|
||||
return str(struct.unpack('>q', struct.pack('>Q', int(x, 16)))[0]) + 'n'
|
||||
if spec['type'] == 'i64':
|
||||
# Make a bigint instead, since `double' cannot fit all i64 values.
|
||||
return x + 'n'
|
||||
return x
|
||||
|
||||
if x == 'nan':
|
||||
@ -304,8 +307,8 @@ def genresult(ident, entry):
|
||||
|
||||
if entry['kind'] == 'return':
|
||||
return (
|
||||
f'let {ident}_result = {expectation};\n ' +
|
||||
(f'expect({ident}_result).toBe({genarg(entry["result"])})\n ' if entry["result"] is not None else '')
|
||||
f'let {ident}_result = {expectation};\n ' +
|
||||
(f'expect({ident}_result).toBe({genarg(entry["result"])})\n ' if entry["result"] is not None else '')
|
||||
)
|
||||
|
||||
if entry['kind'] == 'trap':
|
||||
|
Loading…
Reference in New Issue
Block a user