mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The ComputeEffects pass derives escape information for function arguments and adds those effects in the function. This needs a lot of changes in check-lines in the tests, because the effects are printed in SIL
18 lines
599 B
Swift
18 lines
599 B
Swift
// RUN: %target-swift-frontend -primary-file %s -O -sil-verify-all -module-name=test -emit-sil | %FileCheck %s
|
|
|
|
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
|
|
|
|
|
|
// Check that we can eliminate all optionals from a loop which is iterating
|
|
// over an array of address-only elements.
|
|
|
|
// CHECK-LABEL: sil {{.*}}@$s4test0A18_no_optionals_usedyySayxGlF : $@convention(thin) <T> (@guaranteed Array<T>) -> () {
|
|
// CHECK-NOT: Optional
|
|
// CHECK: } // end sil function '$s4test0A18_no_optionals_usedyySayxGlF'
|
|
public func test_no_optionals_used<T>(_ items: [T]) {
|
|
for i in items {
|
|
print(i)
|
|
}
|
|
}
|
|
|