@@ -310,7 +310,7 @@ func test_isa_1(p: P) {
310
310
a ( )
311
311
// CHECK: function_ref @$s6switch1ayyF
312
312
// CHECK: br [[CONT:bb[0-9]+]]
313
-
313
+
314
314
// CHECK: [[IS_NOT_X]]:
315
315
// CHECK: checked_cast_addr_br copy_on_success P in [[P]] : $*P to Y in {{%.*}} : $*Y, [[IS_Y:bb[0-9]+]], [[IS_NOT_Y:bb[0-9]+]]
316
316
@@ -524,7 +524,7 @@ func test_isa_class_2(x: B) -> AnyObject {
524
524
// CHECK: [[NO_CASE1]]:
525
525
// CHECK: destroy_value [[CAST_D1_COPY]]
526
526
// CHECK: br [[NEXT_CASE:bb5]]
527
-
527
+
528
528
// CHECK: [[IS_NOT_D1]]([[NOCAST_D1:%.*]] : @guaranteed $B):
529
529
// CHECK: end_borrow [[NOCAST_D1]]
530
530
// CHECK: br [[NEXT_CASE]]
@@ -1020,7 +1020,7 @@ func testOptionalEnumMixWithNil(_ a : Int?) -> Int {
1020
1020
// CHECK-LABEL: sil hidden [ossa] @$s6switch43testMultiPatternsWithOuterScopeSameNamedVar4base6filterySiSg_AEtF
1021
1021
func testMultiPatternsWithOuterScopeSameNamedVar( base: Int ? , filter: Int ? ) {
1022
1022
switch ( base, filter) {
1023
-
1023
+
1024
1024
case ( . some( let base) , . some( let filter) ) :
1025
1025
// CHECK: bb2(%10 : $Int):
1026
1026
// CHECK-NEXT: debug_value %8 : $Int, let, name "base"
@@ -1034,7 +1034,7 @@ func testMultiPatternsWithOuterScopeSameNamedVar(base: Int?, filter: Int?) {
1034
1034
// CHECK: bb5([[OTHER_BASE:%.*]] : $Int)
1035
1035
// CHECK-NEXT: debug_value [[OTHER_BASE]] : $Int, let, name "base"
1036
1036
// CHECK-NEXT: br bb6([[OTHER_BASE]] : $Int)
1037
-
1037
+
1038
1038
// CHECK: bb6([[ARG:%.*]] : $Int):
1039
1039
print ( " single: \( base) " )
1040
1040
default :
@@ -1261,3 +1261,27 @@ func partial_address_only_tuple_dispatch_with_fail_case(_ name: Klass, _ value:
1261
1261
break
1262
1262
}
1263
1263
}
1264
+
1265
+ // This was crashing the ownership verifier at some point and was reported in
1266
+ // SR-6664. Just make sure that we still pass the ownership verifier.
1267
+
1268
+ // `indirect` is necessary; generic parameter is necessary.
1269
+ indirect enum SR6664_Base < Element> {
1270
+ // Tuple associated value is necessary; one element must be a function,
1271
+ // the other must be a non-function using the generic parameter.
1272
+ // (The original associated value was `(where: (Element) -> Bool, of: Element?)`,
1273
+ // to give you an idea of the variety of types.)
1274
+ case index( ( Int ) -> Void , Element )
1275
+
1276
+ // Function can be in an extension or not. Can have a return value or not. Can
1277
+ // have a parameter or not. Can be generic or not.
1278
+ func relative( ) {
1279
+ switch self {
1280
+ // Matching the case is necessary. You can capture or ignore the associated
1281
+ // values.
1282
+ case . index:
1283
+ // Body doesn't matter.
1284
+ break
1285
+ }
1286
+ }
1287
+ }
0 commit comments