Files
swift-mirror/test/AutoDiff/stdlib/differentiable_stdlib_conformances.swift
Dan Zheng 6dd557a557 [AutoDiff] NFC: garden tests. (#30588)
Add test/AutoDiff/lit.local.cfg: run tests only when `differentiable_programming`
is enabled in lit. With this, individual tests no longer need
`REQUIRES: differentiable_programming`.

Move multi-functionality SIL tests from test/AutoDiff/SIL/Serialization to
test/AutoDiff/SIL.

Garden test filenames.
2020-03-23 15:22:27 -07:00

21 lines
628 B
Swift

// RUN: %target-run-simple-swift
// REQUIRES: executable_test
import _Differentiation
// Test `Differentiable` protocol conformances for stdlib types.
func assertConformsToDifferentiable<T>(_: T.Type) where T: Differentiable {}
func assertSelfEqualsTangentVector<T>(_: T.Type)
where T: Differentiable, T == T.TangentVector {}
// Test `FloatingPoint` types.
func testFloatingPointDifferentiableConformance() {
assertSelfEqualsTangentVector(Float.self)
assertSelfEqualsTangentVector(Double.self)
#if (arch(i386) || arch(x86_64)) && !(os(Windows) || os(Android))
assertSelfEqualsTangentVector(Float80.self)
#endif
}