[AutoDiff] Add @_exported import _Differentiation test. (#30769)

Verify that importing a module with `@_exported import _Differentiation`
enables differentiable programming. This behavior is desirable.
This commit is contained in:
Dan Zheng
2020-04-02 10:19:56 -07:00
committed by GitHub
parent 9d4ea564c3
commit 172d57fa93
2 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend -emit-module %S/Inputs/exports_differentiation.swift -o %t/exports_differentiation.swiftmodule
// RUN: %target-build-swift %s -I %t
// Test whether importing a module with `@_exported import _Differentiation`
// enables differentiable programming. This behavior is desirable.
import exports_differentiation
@differentiable
func id<T: Differentiable>(_ x: T) -> T { x }