Files
swift-mirror/test/AutoDiff/Sema/ExportedDifferentiationModule/main.swift
Dan Zheng 172d57fa93 [AutoDiff] Add @_exported import _Differentiation test. (#30769)
Verify that importing a module with `@_exported import _Differentiation`
enables differentiable programming. This behavior is desirable.
2020-04-02 10:19:56 -07:00

12 lines
432 B
Swift

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