Files
swift-mirror/test/SILOptimizer/generic_loop.swift
Erik Eckstein eea471fe99 add the ComputeEffects pass
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
2022-04-22 09:50:07 +02:00

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)
}
}