[swift-dev] Test case "tuple_arguments.swift" failed when compiler is built in debug mode on x86_64

Greg Parker gparker at apple.com
Tue Oct 17 04:48:14 CDT 2017


> On Oct 16, 2017, at 9:20 AM, Sam Ding via swift-dev <swift-dev at swift.org> wrote:
> I test the case "tuple_arguments.swift" for v4.0 and found it is failed when the swift compiler is built in "-d" debug mode, but it is passed 
> when built in release mode.
> Here is a simple test case:
> 
> // SR-4738
> 
> let sr4738 = (1, (2, 3))
> [sr4738].map { (x, (y, z)) -> Int in x + y + z } // expected-error {{use of undeclared type 'y'}}
> // expected-error at -1 {{closure tuple parameter does not support destructuring}} {{20-26=arg1}} {{38-38=let (y, z) = arg1
> ; }}
> 
> Save it to a file (for example, tt.swift), then run following commands:
> 
> ` swift -frontend -target x86_64-unknown-linux-gnu -module-cache-path /tmp/ -swift-version 3 -typecheck -verify -disable-objc-attr-requires-foundation-module tt.swift -swift-version 4 `
> 
> If "swift" compiler is built with debug mode ("-d"), then got following output:
> tt.swift:5:96: error: expected fix-it not seen; actual fix-its: {{20-26=arg1}} {{38-38=let = arg1; }}
> .....
> Stack dump:
> 0. Program arguments: swift -frontend -target x86_64-unknown-linux-gnu -module-cache-path /tmp/ -swift-version 3 -typecheck -verify -disable-objc-attr-requires-foundation-module tt.swift -swift-version 4
> Aborted (core dumped)
> 
> The testing "lib/Frontend/DiagnosticVerifier.cpp:: checkForFixIt" gives that 
> the "ActualFixIt" is "let " and "Expected" is "let (y, z) = arg1", and then causes "core dumped" in an assert.
> However the both "ActualFixIt" and "Expected" match when the "swift" is built in release mode.
> Note that the all "fixed-it"s are stored in a list, originally is added by "DiagnosticVerifier::addDiagnostic"
> 
> Can anyone let me know how the compiler build options affect the test results.
> I tested the same case on s390x and found the similar errors.

That error looks like the swift compiler frontend process is crashing during the test. The build configuration of the compiler can definitely affect crashes of the compiler itself. Have you filed a bug report?


-- 
Greg Parker     gparker at apple.com <mailto:gparker at apple.com>     Runtime Wrangler


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20171017/cb8c3e27/attachment.html>


More information about the swift-dev mailing list