Skip to content

Commit 65be456

Browse files
Merge pull request #60991 from AnthonyLatsis/migrate-test-suite-to-gh-issues-24
Gardening: Migrate test suite to GH issues p. 24
2 parents 182c9e9 + ece9a0d commit 65be456

File tree

35 files changed

+148
-99
lines changed

35 files changed

+148
-99
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.

test/AutoDiff/compiler_crashers/sr14223-apply-opened-opened-existential-argument.swift renamed to test/AutoDiff/compiler_crashers/issue-54722-apply-opened-opened-existential-argument.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// RUN: not --crash %target-swift-frontend -disable-availability-checking -emit-sil -verify %s
22

3-
// SR-14223: Differentiation transform crash for `apply` with opened existential arguments.
3+
// https://github.com/apple/swift/issues/54722
4+
// Differentiation transform crash for `apply` with opened existential arguments
45

56
import _Differentiation
67

test/AutoDiff/compiler_crashers/rdar87429620-differentiable-curry-thunk-reqmachine.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
// RUN: %target-swift-frontend -emit-sil -verify %s
22
// XFAIL: *
33

4-
// rdar://87429620 (Differentiable curry thunk RequirementMachine error)
4+
// rdar://87429620
5+
// https://github.com/apple/swift/issues/54819
6+
// Differentiable curry thunk RequirementMachine error
57

68
import _Differentiation
79

8-
public struct SR_14228_Struct<Scalar> {
10+
public struct Struct<Scalar> {
911
var x: Scalar
1012
}
1113

12-
extension SR_14228_Struct: Differentiable where Scalar: Differentiable {
14+
extension Struct: Differentiable where Scalar: Differentiable {
1315
@differentiable(reverse)
1416
public static func id(x: Self) -> Self {
1517
return x
1618
}
1719
}
1820

1921
@differentiable(reverse, wrt: x)
20-
public func SR_14228<Scalar: Differentiable>(
21-
_ x: SR_14228_Struct<Scalar>,
22-
reduction: @differentiable(reverse) (SR_14228_Struct<Scalar>) -> SR_14228_Struct<Scalar> = SR_14228_Struct.id
23-
) -> SR_14228_Struct<Scalar> {
22+
public func f<Scalar: Differentiable>(
23+
_ x: Struct<Scalar>,
24+
reduction: @differentiable(reverse) (Struct<Scalar>) -> Struct<Scalar> = Struct.id
25+
) -> Struct<Scalar> {
2426
reduction(x)
2527
}
2628

test/AutoDiff/compiler_crashers_fixed/sr12493-differentiable-function-extract-subst-function-type.swift renamed to test/AutoDiff/compiler_crashers_fixed/issue-54935-differentiable-function-extract-subst-function-type.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// RUN: %target-build-swift -O %s
22

3-
// SR-12493: SIL verification error regarding substituted function types and
3+
// https://github.com/apple/swift/issues/54935
4+
// SIL verification error regarding substituted function types and
45
// `differentiable_function_extract` instruction. Occurs only with `-O`.
56

6-
// FIXME(SR-13021): Disabled due to flakiness on Linux, likely related to TF-1197.
7+
// FIXME: Disabled due to flakiness on Linux (https://github.com/apple/swift/issues/55466), likely related to TF-1197.
78
// REQUIRES: SR13021
89

910
import _Differentiation
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// RUN: %target-build-swift -O %s
22

3-
// SR-12548: SIL verification error regarding
4-
// `CapturePropagation::rewritePartialApply` for `partial_apply` with
5-
// `@convention(method)` callee.
3+
// https://github.com/apple/swift/issues/54992
4+
// SIL verification error regarding `CapturePropagation::rewritePartialApply`
5+
// for `partial_apply` with `@convention(method)` callee
66

77
import _Differentiation
88

0 commit comments

Comments
 (0)