Skip to content
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

[SR-13354] Upstream LLVM broke PrintFloat.swift.gyb test #55794

Closed
davezarzycki opened this issue Aug 6, 2020 · 6 comments
Closed

[SR-13354] Upstream LLVM broke PrintFloat.swift.gyb test #55794

davezarzycki opened this issue Aug 6, 2020 · 6 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@davezarzycki
Copy link
Collaborator

Previous ID SR-13354
Radar None
Original Reporter @davezarzycki
Type Bug
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee @tbkka
Priority Medium

md5: 6cc503a0199e6b806dbb0880c95bc380

Issue Description:

Upstream LLVM broke the PrintFloat.swift.gyb test. Looking at the LLVM commit stream, it does seem like there are a bunch of sign-related optimizations/changes, so perhaps this isn't surprising. In any case:

FAIL: Swift(linux-x86_64) :: stdlib/PrintFloat.swift.gyb (12664 of 13508)
******************** TEST 'Swift(linux-x86_64) :: stdlib/PrintFloat.swift.gyb' FAILED ********************
Script:
--
: 'RUN: at line 1'; rm -rf "/home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp" && mkdir -p "/home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp"
: 'RUN: at line 2'; /usr/bin/python2.7 /home/dave/s/n/swift/utils/gyb.py /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb -o /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/FloatingPointPrinting.swift
: 'RUN: at line 3'; /usr/bin/python2.7 /home/dave/s/n/swift/utils/line-directive /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/FloatingPointPrinting.swift -- /home/dave/b/n/t/bin/swiftc -target x86_64-unknown-linux-gnu -toolchain-stdlib-rpath -module-cache-path '/home/dave/b/n/t/swift-test-results/x86_64-unknown-linux-gnu/clang-module-cache' -swift-version 4 -Xfrontend -ignore-module-source-info /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/FloatingPointPrinting.swift -o /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/main.out
: 'RUN: at line 4'; echo /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/main.out
: 'RUN: at line 5'; /usr/bin/python2.7 /home/dave/s/n/swift/utils/line-directive /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/FloatingPointPrinting.swift -- /usr/bin/env DYLD_LIBRARY_PATH='/home/dave/b/n/t/lib/swift/linux/x86_64' LD_LIBRARY_PATH='/home/dave/b/n/t/lib/swift/linux/x86_64:' SIMCTL_CHILD_DYLD_LIBRARY_PATH='/home/dave/b/n/t/lib/swift/linux/x86_64' /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/main.out
: 'RUN: at line 6'; /usr/bin/python2.7 /home/dave/s/n/swift/utils/line-directive /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/FloatingPointPrinting.swift -- /usr/bin/env DYLD_LIBRARY_PATH='/home/dave/b/n/t/lib/swift/linux/x86_64' LD_LIBRARY_PATH='/home/dave/b/n/t/lib/swift/linux/x86_64:' SIMCTL_CHILD_DYLD_LIBRARY_PATH='/home/dave/b/n/t/lib/swift/linux/x86_64' /home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/main.out --locale ru_RU.UTF-8
--
Exit Code: 250

Command Output (stdout):
--
/home/dave/b/n/t/tools/swift/test-linux-x86_64/stdlib/Output/PrintFloat.swift.gyb.tmp/main.out
[ RUN ] FloatingPointPrinting.CustomStringConvertible
[ OK ] FloatingPointPrinting.CustomStringConvertible
[ RUN ] FloatingPointPrinting.CustomDebugStringConvertible
[ OK ] FloatingPointPrinting.CustomDebugStringConvertible
[ RUN ] FloatingPointPrinting.Printable_CFloat
[ OK ] FloatingPointPrinting.Printable_CFloat
[ RUN ] FloatingPointPrinting.Printable_CDouble
[ OK ] FloatingPointPrinting.Printable_CDouble
[ RUN ] FloatingPointPrinting.Printable_Float16
[ OK ] FloatingPointPrinting.Printable_Float16
[ RUN ] FloatingPointPrinting.Printable_Float
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 783
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-nan" (of type Swift.String)
stdout>>> actual: "nan" (of type Swift.String)
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 784
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-nan(0xffff)" (of type Swift.String)
stdout>>> actual: "nan(0xffff)" (of type Swift.String)
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 786
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-snan" (of type Swift.String)
stdout>>> actual: "nan" (of type Swift.String)
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 788
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-snan(0xffff)" (of type Swift.String)
stdout>>> actual: "nan(0xffff)" (of type Swift.String)
[ FAIL ] FloatingPointPrinting.Printable_Float
[ RUN ] FloatingPointPrinting.Printable_Double
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 894
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-nan" (of type Swift.String)
stdout>>> actual: "nan" (of type Swift.String)
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 898
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-nan(0xffff)" (of type Swift.String)
stdout>>> actual: "nan(0xffff)" (of type Swift.String)
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 900
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-snan" (of type Swift.String)
stdout>>> actual: "nan" (of type Swift.String)
stdout>>> check failed at /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb, line 902
stdout>>> stacktrace:
stdout>>> #​0: /home/dave/s/n/swift/test/stdlib/PrintFloat.swift.gyb:453
stdout>>> expected: "-snan(0xffff)" (of type Swift.String)
stdout>>> actual: "nan(0xffff)" (of type Swift.String)
[ FAIL ] FloatingPointPrinting.Printable_Double
[ RUN ] FloatingPointPrinti
--
@davezarzycki
Copy link
Collaborator Author

Looks like LLVM 0f2b47b broke this Swift test.

@stephentyrone
Copy link
Member

We probably shouldn't be testing those; nan formally doesn't have a signbit. It's convenient to be able to print it for debugging purposes, but LLVM is free to mess with it however they like (so, we should keep the functionality, but we can't really depend on any test producing a specific result for input values that the compiler can see).

@stephentyrone
Copy link
Member

cc @tbkka; we could read these from a file to block constant propagation, but we can also just accept any nan output as a short-term fix.

@tbkka
Copy link
Contributor

tbkka commented Aug 10, 2020

This test is also discarding signaling/quiet information. Is that expected?

@tbkka
Copy link
Contributor

tbkka commented Aug 10, 2020

PR #33391 comments out the exact check for NaN formatting of .debugDescription on the remaining platforms. (It was already disabled for !x86.)

The test still verifies that:

  • .description outputs "nan"

  • .debugDescription matches `-?s?nan((0x[0-9a-f]*))?`

@tbkka
Copy link
Contributor

tbkka commented Aug 11, 2020

Merged PR #33391. This should now be fixed in master.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants