mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
15 lines
315 B
Swift
15 lines
315 B
Swift
// RUN: %target-swift-frontend -emit-sil -verify %s
|
|
|
|
// https://github.com/swiftlang/swift/issues/81607
|
|
// Ensure we're propagating array adjoint in the correct BB
|
|
|
|
import _Differentiation
|
|
|
|
@differentiable(reverse)
|
|
func sum(_ a: Float, _ b: [Float]) -> [Float] {
|
|
if b.count != 0 {
|
|
return b
|
|
}
|
|
return [a]
|
|
}
|