Skip to content

Commit 172d57f

Browse files
authored
[AutoDiff] Add @_exported import _Differentiation test. (swiftlang#30769)
Verify that importing a module with `@_exported import _Differentiation` enables differentiable programming. This behavior is desirable.
1 parent 9d4ea56 commit 172d57f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
@_exported import _Differentiation
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-frontend -emit-module %S/Inputs/exports_differentiation.swift -o %t/exports_differentiation.swiftmodule
3+
// RUN: %target-build-swift %s -I %t
4+
5+
// Test whether importing a module with `@_exported import _Differentiation`
6+
// enables differentiable programming. This behavior is desirable.
7+
8+
import exports_differentiation
9+
10+
@differentiable
11+
func id<T: Differentiable>(_ x: T) -> T { x }

0 commit comments

Comments
 (0)