Skip to content

Commit ece9a0d

Browse files
committed
Gardening: Migrate test suite to GH issues: AutoDiff/Sema
1 parent 1b2e4f9 commit ece9a0d

File tree

6 files changed

+36
-23
lines changed

6 files changed

+36
-23
lines changed

test/AutoDiff/Sema/DerivativeRegistrationCrossModule/main.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@
44
// "-verify-ignore-unknown" is for "<unknown>:0: note: 'init()' declared here"
55
// RUN: %target-swift-frontend-typecheck -verify -verify-ignore-unknown -I %t %s
66

7-
// SR-12526: Fix cross-module deserialization crash involving `@derivative` attribute.
7+
// https://github.com/apple/swift/issues/54969
8+
// Fix cross-module deserialization crash involving `@derivative` attribute.
89

910
import a
1011
import b
1112

1213
func foo(_ s: Struct) {
13-
// Without this error, SR-12526 does not trigger.
14+
// Without this error, the aforementioned issue does not trigger.
1415
// expected-error @+1 {{'Struct' initializer is inaccessible due to 'internal' protection level}}
1516
_ = Struct()
1617
_ = s.method(1)

test/AutoDiff/Sema/DerivedConformances/class_differentiable.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -542,9 +542,10 @@ where T: AdditiveArithmetic {}
542542
extension NoMemberwiseInitializerExtended: Differentiable
543543
where T: Differentiable & AdditiveArithmetic {}
544544

545-
// SR-12793: Test interaction with `@differentiable` and `@derivative` type-checking.
545+
// https://github.com/apple/swift/issues/55238
546+
// Test interaction with `@differentiable` and `@derivative` type-checking.
546547

547-
class SR_12793: Differentiable {
548+
class C_55238: Differentiable {
548549
@differentiable(reverse)
549550
var x: Float = 0
550551

@@ -593,7 +594,9 @@ class WrappedProperties: Differentiable {
593594

594595
@Wrapper var float: Generic<Float> = Generic()
595596
@ClassWrapper var float2: Generic<Float> = Generic()
596-
// SR-13071: Test `@differentiable` wrapped property.
597+
598+
// https://github.com/apple/swift/issues/55517
599+
// Test `@differentiable` wrapped property.
597600
@differentiable(reverse) @Wrapper var float3: Generic<Float> = Generic()
598601

599602
@noDerivative @ImmutableWrapper var nondiff: Generic<Int> = Generic()

test/AutoDiff/Sema/DerivedConformances/derived_differentiable.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,19 +158,21 @@ extension TangentVectorP where Self == StructWithTangentVectorConstrained.Tangen
158158
// CHECK-AST-LABEL: internal struct StructWithTangentVectorConstrained : TangentVectorConstrained {
159159
// CHECK-AST: internal struct TangentVector : {{(TangentVectorP, Differentiable, AdditiveArithmetic)|(TangentVectorP, AdditiveArithmetic, Differentiable)|(Differentiable, TangentVectorP, AdditiveArithmetic)|(AdditiveArithmetic, TangentVectorP, Differentiable)|(Differentiable, AdditiveArithmetic, TangentVectorP)|(AdditiveArithmetic, Differentiable, TangentVectorP)}} {
160160

161-
public struct SR14241Struct: Differentiable {
161+
// https://github.com/apple/swift/issues/56601
162+
163+
public struct S1: Differentiable {
162164
public var simd: [Float]
163165
public var scalar: Float
164166
}
165167

166-
// CHECK-AST-LABEL: public struct SR14241Struct : Differentiable {
168+
// CHECK-AST-LABEL: public struct S1 : Differentiable {
167169
// CHECK-AST: public var simd: [Float]
168170
// CHECK-AST: public var scalar: Float
169171
// CHECK-AST: struct TangentVector : AdditiveArithmetic, Differentiable {
170172
// CHECK-AST: var simd: Array<Float>.TangentVector
171173
// CHECK-AST: var scalar: Float
172174

173-
// CHECK-SIL-LABEL: public struct SR14241Struct : Differentiable {
175+
// CHECK-SIL-LABEL: public struct S1 : Differentiable {
174176
// CHECK-SIL: @differentiable(reverse, wrt: self)
175177
// CHECK-SIL: @_hasStorage public var simd: [Float] { get set }
176178
// CHECK-SIL: @differentiable(reverse, wrt: self)

test/AutoDiff/Sema/DerivedConformances/struct_differentiable.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,9 +361,10 @@ where T: AdditiveArithmetic {}
361361
extension NoMemberwiseInitializerExtended: Differentiable
362362
where T: Differentiable & AdditiveArithmetic {}
363363

364-
// SR-12793: Test interaction with `@differentiable` and `@derivative` type-checking.
364+
// https://github.com/apple/swift/issues/55238
365+
// Test interaction with `@differentiable` and `@derivative` type-checking.
365366

366-
struct SR_12793: Differentiable {
367+
struct S_55238: Differentiable {
367368
var x: Float
368369

369370
@differentiable(reverse)
@@ -408,7 +409,9 @@ struct WrappedProperties: Differentiable {
408409

409410
@Wrapper var float: Generic<Float>
410411
@ClassWrapper var float2: Generic<Float>
411-
// SR-13071: Test `@differentiable` wrapped property.
412+
413+
// https://github.com/apple/swift/issues/55517
414+
// Test `@differentiable` wrapped property.
412415
@differentiable(reverse) @Wrapper var float3: Generic<Float>
413416

414417
@noDerivative @ImmutableWrapper var nondiff: Generic<Int>

test/AutoDiff/Sema/ImplicitDifferentiableAttributeCrossFile/protocol_default_implementation_witness.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
// RUN: %target-swift-frontend -c -verify -primary-file %s %S/Inputs/other_file_protocol_default_implementation_witness.swift
22

3-
// SR-13455: Test missing protocol requirement `@differentiable` attribute
4-
// errors for protocol witnesses declared in a different file than the protocol
3+
// https://github.com/apple/swift/issues/55897
4+
// Test missing protocol requirement `@differentiable` attribute errors for
5+
// protocol witnesses declared in a different file than the protocol
56
// conformance.
67
//
78
// This test case specifically tests protocol extension method witnesses.

test/AutoDiff/Sema/derivative_attr_type_checking.swift

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -583,20 +583,22 @@ extension Struct where T: Differentiable & AdditiveArithmetic {
583583
}
584584
}
585585

586-
struct SR15530_Struct<T> {}
587-
extension SR15530_Struct: Differentiable where T: Differentiable {}
586+
// https://github.com/apple/swift/issues/57833
588587

589-
extension SR15530_Struct {
590-
// expected-note @+1 {{candidate instance method does not have type equal to or less constrained than '<T where T : Differentiable> (inout SR15530_Struct<T>) -> (Int, @differentiable(reverse) (inout T) -> Void) -> Void'}}
591-
mutating func sr15530_update<D>(at index: Int, byCalling closure: (inout T, D) -> Void, withArgument: D) {
588+
struct Struct2<T> {}
589+
extension Struct2: Differentiable where T: Differentiable {}
590+
591+
extension Struct2 {
592+
// expected-note @+1 {{candidate instance method does not have type equal to or less constrained than '<T where T : Differentiable> (inout Struct2<T>) -> (Int, @differentiable(reverse) (inout T) -> Void) -> Void'}}
593+
mutating func update<D>(at index: Int, byCalling closure: (inout T, D) -> Void, withArgument: D) {
592594
fatalError("Stop")
593595
}
594596
}
595597

596-
extension SR15530_Struct where T: Differentiable {
597-
// expected-error @+1 {{referenced declaration 'sr15530_update' could not be resolved}}
598-
@derivative(of: sr15530_update)
599-
mutating func vjp_sr15530_update(
598+
extension Struct2 where T: Differentiable {
599+
// expected-error @+1 {{referenced declaration 'update' could not be resolved}}
600+
@derivative(of: update)
601+
mutating func vjp_update(
600602
at index: Int,
601603
byCalling closure: @differentiable(reverse) (inout T) -> Void
602604
) -> (value: Void, pullback: (inout Self.TangentVector) -> Void) {
@@ -624,7 +626,8 @@ extension Class where T: Differentiable {
624626
return (1, { _ in .zero })
625627
}
626628

627-
// FIXME(SR-13096): Enable derivative registration for class property/subscript setters.
629+
// FIXME: Enable derivative registration for class property/subscript setters (https://github.com/apple/swift/issues/55542).
630+
//
628631
// This requires changing derivative type calculation rules for functions with
629632
// class-typed parameters. We need to assume that all functions taking
630633
// class-typed operands may mutate those operands.

0 commit comments

Comments
 (0)