Skip to content

SILGen: Add regression test for rdar://problem/44657505 #21074

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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/SILGen/auto_closures.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

// RUN: %target-swift-emit-silgen -module-name auto_closures -enable-sil-ownership -parse-stdlib %s | %FileCheck %s
// RUN: %target-swift-emit-silgen -module-name auto_closures -enable-sil-ownership -parse-stdlib -swift-version 5 %s | %FileCheck %s

struct Bool {}
var false_ = Bool()
Expand Down
16 changes: 16 additions & 0 deletions test/SILGen/auto_closures_swift4.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

// RUN: %target-swift-emit-silgen -module-name auto_closures -enable-sil-ownership -parse-stdlib -swift-version 4 %s

// Swift 4-style autoclosure forwarding should not crash - rdar://problem/44657505

public struct Empty {}

public func x(_: @autoclosure () -> Empty) {}

public func y1(_ message: @autoclosure () -> Empty) {
x(message)
}

public func y2(_ message: @autoclosure @escaping () -> Empty) {
x(message)
}