mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
11
test/AutoDiff/Sema/ExportedDifferentiationModule/main.swift
Normal file
11
test/AutoDiff/Sema/ExportedDifferentiationModule/main.swift
Normal 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 }
|
||||
Reference in New Issue
Block a user