Skip to content

[test] Fix Int128 test on 32-bit platforms #72790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kateinoigakukun
Copy link
Member

The test used Int.min and Int.max assuming that they are 64-bit integers. Use 64-bit integers explicitly instead.
The test failed on WebAssembly CI: https://ci.swift.org/job/oss-swift-pr-test-crosscompile-wasm-ubuntu-20_04/359/console

/home/build-user/build/buildbot_linux/wasmstdlib-linux-x86_64/test-wasi-wasm32/stdlib/Output/Int128.swift.tmp/a.out
[ RUN      ] Int128Tests.Memory layout
[       OK ] Int128Tests.Memory layout
[ RUN      ] Int128Tests.Literals
[       OK ] Int128Tests.Literals
[ RUN      ] Int128Tests.Conversion from Double
[       OK ] Int128Tests.Conversion from Double
[ RUN      ] Int128Tests.Conversion from Float
[       OK ] Int128Tests.Conversion from Float
[ RUN      ] Int128Tests.Conversion from Float16
[       OK ] Int128Tests.Conversion from Float16
[ RUN      ] Int128Tests.Conversion from integers
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 313
first:  -2147483648 (of type Swift.Int128)
second: -9223372036854775808 (of type Swift.Int128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 314
first:  2147483647 (of type Swift.Int128)
second: 9223372036854775807 (of type Swift.Int128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 315
first:  4294967295 (of type Swift.Int128)
second: 18446744073709551615 (of type Swift.Int128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 321
first:  Optional(-2147483648) (of type Swift.Optional)
second: Optional(-9223372036854775808) (of type Swift.Optional)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 322
first:  Optional(2147483647) (of type Swift.Optional)
second: Optional(9223372036854775807) (of type Swift.Optional)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 323
first:  Optional(4294967295) (of type Swift.Optional)
second: Optional(18446744073709551615) (of type Swift.Optional)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 329
first:  -2147483648 (of type Swift.Int128)
second: -9223372036854775808 (of type Swift.Int128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 330
first:  2147483647 (of type Swift.Int128)
second: 9223372036854775807 (of type Swift.Int128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 331
first:  4294967295 (of type Swift.Int128)
second: 18446744073709551615 (of type Swift.Int128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 337
first:  340282366920938463463374607429620727808 (of type Swift.UInt128)
second: 340282366920938463454151235394913435648 (of type Swift.UInt128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 338
first:  2147483647 (of type Swift.UInt128)
second: 9223372036854775807 (of type Swift.UInt128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 339
first:  4294967295 (of type Swift.UInt128)
second: 18446744073709551615 (of type Swift.UInt128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 346
first:  Optional(2147483647) (of type Swift.Optional)
second: Optional(9223372036854775807) (of type Swift.Optional)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 347
first:  Optional(4294967295) (of type Swift.Optional)
second: Optional(18446744073709551615) (of type Swift.Optional)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 354
first:  2147483647 (of type Swift.UInt128)
second: 9223372036854775807 (of type Swift.UInt128)
check failed at /home/build-user/swift/test/stdlib/Int128.swift, line 355
first:  4294967295 (of type Swift.UInt128)
second: 18446744073709551615 (of type Swift.UInt128)
[     FAIL ] Int128Tests.Conversion from integers
[ RUN      ] Int128Tests.Bytes and words
[       OK ] Int128Tests.Bytes and words
[ RUN      ] Int128Tests.Bitwise operations
[       OK ] Int128Tests.Bitwise operations
[ RUN      ] Int128Tests.Addition and subtraction
[       OK ] Int128Tests.Addition and subtraction
[ RUN      ] Int128Tests.Wide multiplication and division
[       OK ] Int128Tests.Wide multiplication and division
[ RUN      ] Int128Tests.Narrow multiplication and division
[       OK ] Int128Tests.Narrow multiplication and division
[ RUN      ] Int128Tests.String roundtrip
[       OK ] Int128Tests.String roundtrip
Int128Tests: Some tests failed, aborting
UXPASS: []
FAIL: ["Conversion from integers"]
SKIP: []

The test used Int.min and Int.max assuming that they are 64-bit integers.
Use 64-bit integers explicitly instead.
@kateinoigakukun kateinoigakukun requested a review from a team as a code owner April 3, 2024 00:48
@kateinoigakukun
Copy link
Member Author

@swift-ci test WebAssembly

@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

@kateinoigakukun
Copy link
Member Author

The Linux CI failure on TestSwiftExprMissingType.py seems happening on main too

@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test

stephentyrone added a commit to stephentyrone/swift that referenced this pull request Apr 3, 2024
@kateinoigakukun
Copy link
Member Author

@swift-ci smoke test Windows

@kateinoigakukun kateinoigakukun merged commit 82af38f into swiftlang:main Apr 3, 2024
@kateinoigakukun kateinoigakukun deleted the yt/fix-int128-32bit-platform branch April 4, 2024 04:11
@kateinoigakukun kateinoigakukun added the WebAssembly Platform: WebAssembly label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
WebAssembly Platform: WebAssembly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants