Skip to content

Gardening: Migrate test suite to GH issues p. 21 #60948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/SILGen/magic_identifier_file.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
// Test in "Swift 6" mode:
// RUN: %target-swift-emit-silgen -I %t -enable-experimental-concise-pound-file -module-name Foo %/s | %FileCheck --check-prefixes=BOTH,CONCISE %s

// TODO: Update RUN lines currently using -enable-experimental-concise-pound-file to use -swift-version <whatever> instead. (SR-13199)
// TODO: Update RUN lines currently using
// -enable-experimental-concise-pound-file to use -swift-version <whatever>
// instead (https://github.com/apple/swift/issues/55639).

import MagicIdentifierFileSwift5
import MagicIdentifierFileSwift6
Expand Down
2 changes: 1 addition & 1 deletion test/SILGen/mangling_retroactive.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ extension ExternalGeneric: Error where Argument: Error { }
func useRequiresError(_: RequiresError<ExternalGeneric<Error>>) {}
// CHECK: sil hidden [ossa] @$s20mangling_retroactive16useRequiresErroryyAA0dE0Vy12RetroactiveB15ExternalGenericVys0E0_pGAIsAhAsAH_psAHHPyHC_HCg_GF

// SR-10926
// https://github.com/apple/swift/issues/53317
protocol OurBaseProtocol: P {
associatedtype Assoc: P
}
Expand Down
8 changes: 6 additions & 2 deletions test/SILGen/objc_attr_NSManaged.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@ func testFinal(_ obj: FinalGizmo) -> String {
return obj.y
}

// SR-2673: @NSManaged property can't satisfy protocol requirement
// https://github.com/apple/swift/issues/45278
// '@NSManaged' property can't satisfy protocol requirement

@objc protocol ObjCProto {
var managedProp: String { get set }
var managedExtProp: AnyObject { get }
Expand All @@ -94,7 +96,9 @@ extension ProtoAdopter {
}


// SR-6534: @NSManaged properties can be 'final'
// https://github.com/apple/swift/issues/49084
// '@NSManaged' properties can be 'final'

protocol EntityIDProto {
var entityID: String { get set }
}
Expand Down
2 changes: 1 addition & 1 deletion test/SILGen/objc_error.swift
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func eraseFictionalServerError() -> Error {
}
// CHECK: } // end sil function '$s10objc_error25eraseFictionalServerErrors0F0_pyF'

// SR-1562
// https://github.com/apple/swift/issues/44171
extension Error {
// CHECK-LABEL: sil hidden [ossa] @$ss5ErrorP10objc_errorE16convertToNSErrorSo0F0CyF
// CHECK: bb0([[SELF:%[0-9]+]] : $*Self)
Expand Down
3 changes: 2 additions & 1 deletion test/SILGen/objc_extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ extension SubSub {
}
}

// SR-1025
// https://github.com/apple/swift/issues/43637

extension Base {
fileprivate static var x = 1
}
Expand Down
4 changes: 2 additions & 2 deletions test/SILGen/objc_init_iuo_override.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SR-8789

// RUN: %target-swift-emit-silgen -verify -import-objc-header %S/Inputs/objc_init_iuo_override.h %s
// REQUIRES: objc_interop

// https://github.com/apple/swift/issues/51297

class ChildClass: ParentClass {}

class GrandchildClass: ChildClass {
Expand Down
4 changes: 2 additions & 2 deletions test/SILGen/objc_properties.swift
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ class NonObjCBaseClass : NSObject {
// CHECK-LABEL: sil private [thunk] [ossa] @$s15objc_properties12ObjCSubclassC8propertySivsTo

// Make sure lazy properties that witness @objc protocol requirements are
// correctly formed
// correctly formed.
//
// <https://bugs.swift.org/browse/SR-1825>
// https://github.com/apple/swift/issues/44434

@objc protocol HasProperty {
@objc var window: NSObject? { get set }
Expand Down
46 changes: 27 additions & 19 deletions test/SILGen/property_wrappers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,9 @@ public class Container {
}
}

// SR-11303 / rdar://problem/54311335 - crash due to wrong archetype used in generated SIL
// rdar://problem/54311335
// https://github.com/apple/swift/issues/53704
// Crash due to wrong archetype used in generated SIL
public protocol TestProtocol {}
public class TestClass<T> {
@WrapperWithInitialValue var value: T
Expand Down Expand Up @@ -801,7 +803,9 @@ extension UsesMyPublished {
}
}

// SR-11603 - crash due to incorrect lvalue computation
// https://github.com/apple/swift/issues/54010
// Crash due to incorrect lvalue computation

@propertyWrapper
struct StructWrapper<T> {
var wrappedValue: T
Expand All @@ -815,7 +819,7 @@ class ClassWrapper<T> {
}
}

struct SR_11603 {
struct S_54010 {
@StructWrapper @ClassWrapper var prop: Int

func foo() {
Expand Down Expand Up @@ -908,7 +912,9 @@ struct NonMutatingWrapperTestStruct {
}


// SR-12443: Crash on property with wrapper override that adds observer.
// https://github.com/apple/swift/issues/54882
// Crash on property with wrapper override that adds observer.

@propertyWrapper
struct BasicIntWrapper {
var wrappedValue: Int
Expand Down Expand Up @@ -957,31 +963,33 @@ struct TestAutoclosureComposition {
@Once @ObservedObject var model = Model()
}

// https://github.com/apple/swift/issues/58201

@propertyWrapper
struct SR_15940Foo {
struct BasicComputedIntWrapper {
var wrappedValue: Int { 0 }
}

struct SR_15940_C {
struct S_58201 {
func a() {
@SR_15940Foo var b: Int
@BasicComputedIntWrapper var b: Int
}
}

// CHECK-LABEL: sil hidden [ossa] @$s17property_wrappers10SR_15940_CV1ayyF : $@convention(method) (SR_15940_C) -> () {
// CHECK: bb0(%0 : $SR_15940_C):
// CHECK-NEXT: debug_value %0 : $SR_15940_C, let, name "self", argno 1, implicit
// CHECK-NEXT: [[BOX:%.*]] = alloc_box ${ var SR_15940Foo }, var, name "_b"
// CHECK-NEXT: [[BOXADDR:%.*]] = project_box [[BOX]] : ${ var SR_15940Foo }, 0
// CHECK-NEXT: [[METATYPE:%.*]] = metatype $@thin SR_15940Foo.Type
// CHECK-NEXT: // function_ref SR_15940Foo.init()
// CHECK-NEXT: [[DEFAULTVALUE_FN:%.*]] = function_ref @$s17property_wrappers11SR_15940FooVACycfC : $@convention(method) (@thin SR_15940Foo.Type) -> SR_15940Foo
// CHECK-NEXT: [[DEFAULTRESULT:%.*]] = apply [[DEFAULTVALUE_FN]]([[METATYPE]]) : $@convention(method) (@thin SR_15940Foo.Type) -> SR_15940Foo
// CHECK-NEXT: store [[DEFAULTRESULT]] to [trivial] [[BOXADDR]] : $*SR_15940Foo
// CHECK-NEXT: destroy_value [[BOX]] : ${ var SR_15940Foo }
// CHECK-LABEL: sil hidden [ossa] @$s17property_wrappers7S_58201V1ayyF : $@convention(method) (S_58201) -> () {
// CHECK: bb0(%0 : $S_58201):
// CHECK-NEXT: debug_value %0 : $S_58201, let, name "self", argno 1, implicit
// CHECK-NEXT: [[BOX:%.*]] = alloc_box ${ var BasicComputedIntWrapper }, var, name "_b"
// CHECK-NEXT: [[BOXADDR:%.*]] = project_box [[BOX]] : ${ var BasicComputedIntWrapper }, 0
// CHECK-NEXT: [[METATYPE:%.*]] = metatype $@thin BasicComputedIntWrapper.Type
// CHECK-NEXT: // function_ref BasicComputedIntWrapper.init()
// CHECK-NEXT: [[DEFAULTVALUE_FN:%.*]] = function_ref @$s17property_wrappers23BasicComputedIntWrapperVACycfC : $@convention(method) (@thin BasicComputedIntWrapper.Type) -> BasicComputedIntWrapper
// CHECK-NEXT: [[DEFAULTRESULT:%.*]] = apply [[DEFAULTVALUE_FN]]([[METATYPE]]) : $@convention(method) (@thin BasicComputedIntWrapper.Type) -> BasicComputedIntWrapper
// CHECK-NEXT: store [[DEFAULTRESULT]] to [trivial] [[BOXADDR]] : $*BasicComputedIntWrapper
// CHECK-NEXT: destroy_value [[BOX]] : ${ var BasicComputedIntWrapper }
// CHECK-NEXT: [[TUPLE:%.*]] = tuple ()
// CHECK-NEXT: return [[TUPLE]] : $()
// CHECK-NEXT: } // end sil function '$s17property_wrappers10SR_15940_CV1ayyF
// CHECK-NEXT: } // end sil function '$s17property_wrappers7S_58201V1ayyF'

// CHECK-LABEL: sil_vtable ClassUsingWrapper {
// CHECK-NEXT: #ClassUsingWrapper.x!getter: (ClassUsingWrapper) -> () -> Int : @$s17property_wrappers17ClassUsingWrapperC1xSivg // ClassUsingWrapper.x.getter
Expand Down
2 changes: 1 addition & 1 deletion test/SILGen/protocols.swift
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ public func test(_ p: Proto) {
// CHECK: end_apply [[TOKEN]]
// CHECK: return

// SR-11748
// https://github.com/apple/swift/issues/54155

protocol SelfReturningSubscript {
subscript(b: Int) -> Self { get }
Expand Down
2 changes: 1 addition & 1 deletion test/SILGen/reabstract-tuple.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

// RUN: %target-swift-emit-silgen -verify %s | %FileCheck %s

// SR-3090:
// https://github.com/apple/swift/issues/45680

class Box<T> {
public let value: T
Expand Down
3 changes: 2 additions & 1 deletion test/SILGen/subscripts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ do {
inoutFunc(&b[(1,2),(2,3)])
}

// https://bugs.swift.org/browse/SR-1816
// https://github.com/apple/swift/issues/44425

public struct Flags: OptionSet {
public var rawValue: Int
public init(rawValue: Int) { self.rawValue = rawValue }
Expand Down
6 changes: 4 additions & 2 deletions test/SILGen/super.swift
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,10 @@ public class ChildToFixedParent : OutsideParent {
// CHECK: } // end sil function '$s5super18ChildToFixedParentC11returnsSelfACXDyFZ'
}

// https://bugs.swift.org/browse/SR-10260 - super.foo() call across a module
// boundary from a subclass that does not override foo().
// https://github.com/apple/swift/issues/52660
// 'super.foo()' call across a module boundary from a subclass that does
// not override 'foo()'.

public class SuperCallToNonOverriddenMethod : OutsideParent {
public func newMethod() {
super.method()
Expand Down
10 changes: 6 additions & 4 deletions test/SILGen/switch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,8 @@ func testOptionalEnumMixWithNil(_ a : Int?) -> Int {
}
}

// SR-3518
// https://github.com/apple/swift/issues/46106
//
// CHECK-LABEL: sil hidden [ossa] @$s6switch43testMultiPatternsWithOuterScopeSameNamedVar4base6filterySiSg_AEtF
func testMultiPatternsWithOuterScopeSameNamedVar(base: Int?, filter: Int?) {
switch(base, filter) {
Expand Down Expand Up @@ -1288,10 +1289,11 @@ func partial_address_only_tuple_dispatch_with_fail_case(_ name: Klass, _ value:
}

// This was crashing the ownership verifier at some point and was reported in
// SR-6664. Just make sure that we still pass the ownership verifier.

// https://github.com/apple/swift/issues/49213. Just make sure that we still
// pass the ownership verifier.
//
// `indirect` is necessary; generic parameter is necessary.
indirect enum SR6664_Base<Element> {
indirect enum IndirectGenericEnum<Element> {
// Tuple associated value is necessary; one element must be a function,
// the other must be a non-function using the generic parameter.
// (The original associated value was `(where: (Element) -> Bool, of: Element?)`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// RUN: %target-swift-emit-silgen %s | %FileCheck %s

// This is a GenericSignatureBuilder bug fixed with the Requirement Machine, from
// https://bugs.swift.org/browse/SR-15917.
// This is a GenericSignatureBuilder bug fixed with the Requirement Machine,
// from https://github.com/apple/swift/issues/58178.

public struct Foo<Unused: CaseIterable> {
public struct Nested {}
Expand Down
13 changes: 8 additions & 5 deletions test/SILGen/unreachable_code.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,10 @@ func testUnreachableCase5(a : Tree) {
}
}

// https://github.com/apple/swift/issues/48333
func testOptionalEvaluationBreak(a : Tree) {
class SR5763 { func foo() {} }
func createOptional() -> SR5763? { return SR5763() }
class C { func foo() {} }
func createOptional() -> C? { return C() }
switch a {
case _:
break
Expand All @@ -130,7 +131,8 @@ class TestThrowInInit {
}
}

func sr6141() {
// https://github.com/apple/swift/issues/48696
func f_48696() {
var bar: String? = ""
return;
bar?.append("x") // expected-warning{{code after 'return' will never be executed}}
Expand All @@ -147,11 +149,12 @@ func testUnreachableCatchClause() {
}
}

func sr13639() -> Int {
// https://github.com/apple/swift/issues/56075
func f_56075() -> Int {
return Foo.bar
struct Foo { // no-warning
static var bar = 0
// CHECK: sil private @$s16unreachable_code7sr13639SiyF3FooL_V7fooFuncyyF : $@convention(method) (Foo) -> ()
// CHECK: sil private @$s16unreachable_code7f_56075SiyF3FooL_V7fooFuncyyF : $@convention(method) (Foo) -> ()
func fooFunc() {}
}
func appendix() {} // no-warning
Expand Down
2 changes: 1 addition & 1 deletion test/SILOptimizer/OSLogFullOptTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// dead_array_elim.swift. The problem can be overcome by handling
// non-trivial stores in OSSA, as described here:
// [OSSA] Improve DeadObjectElimination to handle array copies
// https://bugs.swift.org/browse/SR-13782
// https://github.com/apple/swift/issues/56179
// Once that bug is fixed, remove the requirement: swift_stdlib_no_asserts.

import OSLogTestHelper
Expand Down
5 changes: 4 additions & 1 deletion test/SILOptimizer/copyforward_ossa.sil
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ bb0(%0 : $*T, %1 : $*T):
return %r1 : $()
}

// <rdar://problem/43888666> [SR-8526]: Memory leak after switch in release configuration
// rdar://problem/43888666
// https://github.com/apple/swift/issues/51046
// Memory leak after switch in release configuration
//
// CHECK-LABEL: sil [ossa] @testGlobalHoistToStoredValue : $@convention(thin) (@owned AClass, @inout AClass) -> () {
// CHECK: bb0(%0 : @owned $AClass, %1 : $*AClass):
// CHECK-NEXT: [[LOCAL:%.*]] = alloc_stack $AClass
Expand Down
2 changes: 1 addition & 1 deletion test/SILOptimizer/dead_array_elim.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// second array is initialized by copying the first. This problem can be
// overcome by handling non-trivial stores in OSSA, as described here:
// [OSSA] Improve DeadObjectElimination to handle array copies
// https://bugs.swift.org/browse/SR-13782
// https://github.com/apple/swift/issues/56179
// Once that bug is fixed, remove the requirement: swift_stdlib_no_asserts.

// CHECK-LABEL: sil hidden @$s15dead_array_elim24testDeadArrayEliminationyyF
Expand Down
3 changes: 2 additions & 1 deletion test/SILOptimizer/dead_code_elimination_ossa.sil
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ bb0(%0 : @owned $(String, (Int, Int, String))):

// Test fix_lifetime of a struct and tuple. It cannot be removed
// without proving reference uniqueness first.
// rdar://36038096 ([SR-6608] DeadCodeElimination removes fix_lifetime instructions.)
// rdar://36038096
// https://github.com/apple/swift/issues/49158
//
// CHECK-LABEL: @testFixLifetimeTuple : $@convention(thin) (@owned S, @owned AnyObject) -> () {
// CHECK: bb0(%0 : $S, %1 : $AnyObject):
Expand Down
Loading