|
1 |
| -// RUN: %target-swift-frontend -emit-sil -requirement-machine=off -verify %s |
| 1 | +// RUN: %target-swift-frontend -emit-sil -verify %s |
2 | 2 |
|
3 | 3 | // Test differentiation transform diagnostics.
|
4 | 4 |
|
@@ -773,27 +773,31 @@ public func fragileDifferentiable(_ x: Float) -> Float {
|
773 | 773 | implicitlyDifferentiableFromFragile(x)
|
774 | 774 | }
|
775 | 775 |
|
| 776 | + |
| 777 | +// FIXME(rdar://87429620): Differentiable curry thunk RequirementMachine error. |
| 778 | +#if false |
776 | 779 | // TF-1208: Test curry thunk differentiation regression.
|
777 |
| -public struct TF_1208_Struct<Scalar> { |
| 780 | +public struct SR_14228_Struct<Scalar> { |
778 | 781 | var x: Scalar
|
779 | 782 | }
|
780 |
| -extension TF_1208_Struct: Differentiable where Scalar: Differentiable { |
| 783 | +extension SR_14228_Struct: Differentiable where Scalar: Differentiable { |
781 | 784 | @differentiable(reverse)
|
782 | 785 | public static func id(x: Self) -> Self {
|
783 | 786 | return x
|
784 | 787 | }
|
785 | 788 | }
|
786 | 789 | @differentiable(reverse, wrt: x)
|
787 |
| -public func TF_1208<Scalar: Differentiable>( |
788 |
| - _ x: TF_1208_Struct<Scalar>, |
789 |
| - // NOTE(TF-1208): This diagnostic is unexpected because `TF_1208_Struct.id` is marked `@differentiable`. |
790 |
| - // expected-error @+3 2 {{function is not differentiable}} |
791 |
| - // expected-note @+2 {{differentiated functions in '@inlinable' functions must be marked '@differentiable' or have a public '@derivative'; this is not possible with a closure, make a top-level function instead}} |
792 |
| - // expected-note @+1 {{opaque non-'@differentiable' function is not differentiable}} |
793 |
| - reduction: @differentiable(reverse) (TF_1208_Struct<Scalar>) -> TF_1208_Struct<Scalar> = TF_1208_Struct.id |
794 |
| -) -> TF_1208_Struct<Scalar> { |
| 790 | +public func SR_14228<Scalar: Differentiable>( |
| 791 | + _ x: SR_14228_Struct<Scalar>, |
| 792 | + // NOTE(TF-1208): This diagnostic is unexpected because `SR_14228_Struct.id` is marked `@differentiable`. |
| 793 | + // xpected-error @+3 2 {{function is not differentiable}} |
| 794 | + // xpected-note @+2 {{differentiated functions in '@inlinable' functions must be marked '@differentiable' or have a public '@derivative'; this is not possible with a closure, make a top-level function instead}} |
| 795 | + // xpected-note @+1 {{opaque non-'@differentiable' function is not differentiable}} |
| 796 | + reduction: @differentiable(reverse) (SR_14228_Struct<Scalar>) -> SR_14228_Struct<Scalar> = SR_14228_Struct.id |
| 797 | +) -> SR_14228_Struct<Scalar> { |
795 | 798 | reduction(x)
|
796 | 799 | }
|
| 800 | +#endif |
797 | 801 |
|
798 | 802 | //===----------------------------------------------------------------------===//
|
799 | 803 | // Coroutines (SIL function yields, `begin_apply`) (not yet supported)
|
|
0 commit comments