Skip to content

[Testing] Unbreak minimal Swift builds #36990

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 1 commit into from
Apr 22, 2021
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
16 changes: 1 addition & 15 deletions test/SILOptimizer/closure_lifetime_fixup.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %S/../Inputs/resilient_struct.swift -enable-library-evolution -emit-module -emit-module-path %t/resilient_struct.swiftmodule
// RUN: %target-swift-frontend %S/../Inputs/resilient_enum.swift -I %t -enable-library-evolution -emit-module -emit-module-path %t/resilient_enum.swiftmodule
// RUN: %target-swift-frontend %s -sil-verify-all -enable-experimental-concurrency -emit-sil -disable-copy-propagation -I %t -o - | %FileCheck %s
// RUN: %target-swift-frontend %s -sil-verify-all -emit-sil -disable-copy-propagation -I %t -o - | %FileCheck %s

// Using -disable-copy-propagation to pattern match against older SIL
// output. At least until -enable-copy-propagation has been around
Expand Down Expand Up @@ -63,20 +63,6 @@ public func testGeneric(c: C) {
use_closureGeneric { return c.returnInt() }
}

// CHECK-LABEL: sil @$s22closure_lifetime_fixup12testAsyncLetyS2SYaF : $@convention(thin) @async (@guaranteed String) -> @owned String {
// CHECK: [[PA:%.*]] = partial_apply [callee_guaranteed] [on_stack]
// CHECK: [[MD:%.*]] = mark_dependence [[PA]]
// CHECK: [[CONV:%.*]] = convert_function [[MD]]
// CHECK: [[BAL:%.*]] = builtin "startAsyncLet"<String>([[CONV]]
// CHECK: builtin "endAsyncLet"([[BAL]] : $Builtin.RawPointer, [[MD]]
// CHECK: } // end sil function '$s22closure_lifetime_fixup12testAsyncLetyS2SYaF'

public func testAsyncLet(_ n: String) async -> String {
async let first = n
let result = await first
return result
}

public protocol P {
associatedtype Element
subscript<U>(a: (Element) -> U, b: (U) -> Element) -> U { get set }
Expand Down
17 changes: 17 additions & 0 deletions test/SILOptimizer/closure_lifetime_fixup_concurrency.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %s -sil-verify-all -enable-experimental-concurrency -emit-sil -disable-copy-propagation -I %t -o - | %FileCheck %s
// REQUIRES: concurrency

// CHECK-LABEL: sil @$s34closure_lifetime_fixup_concurrency12testAsyncLetyS2SYaF : $@convention(thin) @async (@guaranteed String) -> @owned String {
// CHECK: [[PA:%.*]] = partial_apply [callee_guaranteed] [on_stack]
// CHECK: [[MD:%.*]] = mark_dependence [[PA]]
// CHECK: [[CONV:%.*]] = convert_function [[MD]]
// CHECK: [[BAL:%.*]] = builtin "startAsyncLet"<String>([[CONV]]
// CHECK: builtin "endAsyncLet"([[BAL]] : $Builtin.RawPointer, [[MD]]
// CHECK: } // end sil function '$s34closure_lifetime_fixup_concurrency12testAsyncLetyS2SYaF'

public func testAsyncLet(_ n: String) async -> String {
async let first = n
let result = await first
return result
}