   s.x *= x * s.z
   return s.x
 }
+
+//===----------------------------------------------------------------------===//
+// Array literal initialization
+//===----------------------------------------------------------------------===//
+
+// expected-error @+1 {{function is not differentiable}}
+@differentiable
+// expected-note @+1 {{when differentiating this function definition}}
+func tupleArrayLiteralInitialization(_ x: Float, _ y: Float) -> Float {
+  // `Array<(Float, Float)>` does not conform to `Differentiable`.
+  let array = [(x * y, x * y)]
+  // expected-note @+1 {{cannot differentiate through a non-differentiable argument; do you want to use 'withoutDerivative(at:)'?}}
+  return array[0].0
+}
+
+//===----------------------------------------------------------------------===//
+// Subset parameter differentiation thunks
+//===----------------------------------------------------------------------===//
+
+// FIXME(SR-13046): Non-differentiability diagnostic crash due to invalid source location.
+/*
+func testNoDerivativeParameter(_ f: @differentiable (Float, @noDerivative Float) -> Float) -> Float {
+  return gradient(at: 2) { x in f(x * x, x) }
+}
+*/
+
+// Test parameter subset thunk + partially-applied original function.
+struct TF_675 : Differentiable {
+  @differentiable
+  func method(_ x: Float) -> Float {
+    return x
+  }
+}
+let _: @differentiable (Float) -> Float = TF_675().method
+
+// TF-918: Test parameter subset thunk + partially-applied original function.
+let _: @differentiable (Float, Float) -> Float = (+) as @differentiable (Float, @noDerivative Float) -> Float
+
+//===----------------------------------------------------------------------===//
+// Differentiation in fragile functions
+//===----------------------------------------------------------------------===//
+
+public func implicitlyDifferentiableFromFragile(_ x: Float) -> Float { x }
+
+public func hasImplicitlyDifferentiatedTopLevelDefaultArgument(
+// expected-error @+2 {{function is not differentiable}}
+// expected-note @+1 {{differentiated functions in default arguments must be marked '@differentiable' or have a public '@derivative'}}
+  _ f: @differentiable (Float) -> Float = implicitlyDifferentiableFromFragile
+) {}
+
+// TODO(TF-1030): This will eventually not be an error.
+// expected-error @+2 {{function is not differentiable}}
+// expected-note @+1 {{differentiated functions in default arguments must be marked '@differentiable' or have a public '@derivative'; this is not possible with a closure, make a top-level function instead}}
+public func hasImplicitlyDifferentiatedClosureDefaultArgument(_ f: @differentiable (Float) -> Float = { $0 }) {}
+
+@inlinable
+public func fragileFuncWithGradient() {
+  // expected-error @+2 {{function is not differentiable}}
+  // expected-note @+1 {{differentiated functions in '@inlinable' functions must be marked '@differentiable' or have a public '@derivative'}}
+  _ = gradient(at: 0, in: implicitlyDifferentiableFromFragile)
+}
+
+@inlinable
+@differentiable
+public func fragileDifferentiable(_ x: Float) -> Float {
+  // expected-error @+2 {{expression is not differentiable}}
+  // expected-note @+1 {{differentiated functions in '@inlinable' functions must be marked '@differentiable' or have a public '@derivative'}}
+  implicitlyDifferentiableFromFragile(x)
+}
+
+// TF-1208: Test curry thunk differentiation regression.
+public struct TF_1208_Struct<Scalar> {
+  var x: Scalar
+}
+extension TF_1208_Struct: Differentiable where Scalar: Differentiable {
+  @differentiable
+  public static func id(x: Self) -> Self {
+    return x
+  }
+}
+@differentiable(wrt: x)
+public func TF_1208<Scalar: Differentiable>(
+  _ x: TF_1208_Struct<Scalar>,
+  // NOTE(TF-1208): This diagnostic is unexpected because `TF_1208_Struct.id` is marked `@differentiable`.
+  // expected-error @+3 2 {{function is not differentiable}}
+  // 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}}
+  // expected-note @+1 {{opaque non-'@differentiable' function is not differentiable}}
+  reduction: @differentiable (TF_1208_Struct<Scalar>) -> TF_1208_Struct<Scalar> = TF_1208_Struct.id
+) -> TF_1208_Struct<Scalar> {
+  reduction(x)
+}
+
+//===----------------------------------------------------------------------===//
+// Coroutines (SIL function yields, `begin_apply`) (not yet supported)
+//===----------------------------------------------------------------------===//
+
+struct HasCoroutineAccessors: Differentiable {
+  var stored: Float
+  var computed: Float {
+    // `_read` is a coroutine: `(Self) -> () -> ()`.
+    _read { yield stored }
+    // `_modify` is a coroutine: `(inout Self) -> () -> ()`.
+    _modify { yield &stored }
+  }
+}
+// expected-error @+2 {{function is not differentiable}}
+// expected-note @+2 {{when differentiating this function definition}}
+@differentiable
+func testAccessorCoroutines(_ x: HasCoroutineAccessors) -> HasCoroutineAccessors {
+  var x = x
+  // expected-note @+1 {{differentiation of coroutine calls is not yet supported}}
+  x.computed = x.computed
+  return x
+}
+
+// TF-1078: Diagnose `_modify` accessor application with active `inout` argument.
+// expected-error @+2 {{function is not differentiable}}
+// expected-note @+2 {{when differentiating this function definition}}
+@differentiable
+func TF_1078(array: [Float], x: Float) -> Float {
+  var array = array
+  // Array subscript assignment below calls `Array.subscript.modify`.
+  // expected-note @+1 {{differentiation of coroutine calls is not yet supported}}
+  array[0] = x
+  return array[0]
+}
+
+// TF-1115: Diagnose `_modify` accessor application with initially non-active `inout` argument.
+// expected-error @+2 {{function is not differentiable}}
+// expected-note @+2 {{when differentiating this function definition}}
+@differentiable
+func TF_1115(_ x: Float) -> Float {
+  var array: [Float] = [0]
+  // Array subscript assignment below calls `Array.subscript.modify`.
+  // expected-note @+1 {{differentiation of coroutine calls is not yet supported}}
+  array[0] = x
+  return array[0]
+}
+
+// TF-1115: Test `_modify` accessor application with initially non-active `inout` argument,
+// where the yielded value is not a projection from `self`.
+extension Float {
+  static var staticProperty: Float = 1
+
+  var projection: Float {
+    get { self }
+    // This `modify` accessor yields a static variable, not a projection from `self`.
+    // Diagnosing active applications is nonetheless a safe over-approximation.
+    _modify { yield &Float.staticProperty }
+  }
+}
+
+// expected-error @+2 {{function is not differentiable}}
+// expected-note @+2 {{when differentiating this function definition}}
+@differentiable
+func TF_1115_modifyNonSelfProjection(x: Float) -> Float {
+  var result: Float = 0
+  // Assignment below calls `Float.projection.modify`.
+  // expected-note @+1 {{differentiation of coroutine calls is not yet supported}}
+  result.projection = x
+  return result
+}
+
+//===----------------------------------------------------------------------===//
+// Conversion to `@differentiable(linear)` (not yet supported)
+//===----------------------------------------------------------------------===//
+
+// expected-error @+1 {{conversion to '@differentiable(linear)' function type is not yet supported}}
+let _: @differentiable(linear) (Float) -> Float = { x in x }

let _: @differentiable (Float) -> TF_691<Float> = { x in id(TF_691(x)) }

//===----------------------------------------------------------------------===//
// Property wrappers
//===----------------------------------------------------------------------===//

@propertyWrapper

  }
}

//===----------------------------------------------------------------------===//
// `Differentiable` conformance requirement inference
//===----------------------------------------------------------------------===//

func id<T>(_ x: T) -> T { x }
