diff --git a/include/swift/SIL/SILFunction.h b/include/swift/SIL/SILFunction.h index a8d5b1c5b0f6e..c1ed6a24b16ad 100644 --- a/include/swift/SIL/SILFunction.h +++ b/include/swift/SIL/SILFunction.h @@ -1337,7 +1337,7 @@ class SILFunction SubstitutionMap forwardingSubs) { GenericEnv = env; CapturedEnvs = capturedEnvs; - ForwardingSubMap = forwardingSubs; + ForwardingSubMap = forwardingSubs.getCanonical(); } /// Retrieve the generic signature from the generic environment of this diff --git a/include/swift/SIL/SILInstruction.h b/include/swift/SIL/SILInstruction.h index 9f3bfc7bf5dd6..b641205a3d818 100644 --- a/include/swift/SIL/SILInstruction.h +++ b/include/swift/SIL/SILInstruction.h @@ -2674,7 +2674,7 @@ class ApplyInstBase : public Base { : Base(kind, DebugLoc, baseArgs...), SubstCalleeType(substCalleeType), SpecializationInfo(specializationInfo), NumCallArguments(args.size()), NumTypeDependentOperands(typeDependentOperands.size()), - Substitutions(subs) { + Substitutions(subs.getCanonical()) { assert(!!subs == !!callee->getType().castTo() ->getInvocationGenericSignature()); @@ -5983,7 +5983,7 @@ class ThunkInst final Kind kind, SubstitutionMap subs) : UnaryInstructionWithTypeDependentOperandsBase( debugLoc, operand, typeDependentOperands, outputType), - kind(kind), substitutions(subs) {} + kind(kind), substitutions(subs.getCanonical()) {} static ThunkInst *create(SILDebugLocation debugLoc, SILValue operand, SILModule &mod, SILFunction *func, Kind kind, @@ -8650,7 +8650,7 @@ class InitBlockStorageHeaderInst SILValue InvokeFunction, SILType BlockType, SubstitutionMap Subs) : InstructionBase(DebugLoc, BlockType), - Substitutions(Subs), + Substitutions(Subs.getCanonical()), Operands(this, BlockStorage, InvokeFunction) { } diff --git a/lib/SIL/IR/SILInstructions.cpp b/lib/SIL/IR/SILInstructions.cpp index 6d7f611720574..b9d7549a48a2a 100644 --- a/lib/SIL/IR/SILInstructions.cpp +++ b/lib/SIL/IR/SILInstructions.cpp @@ -525,7 +525,7 @@ BuiltinInst::BuiltinInst(SILDebugLocation Loc, Identifier Name, ArrayRef allOperands, unsigned numNormalOperands) : InstructionBaseWithTrailingOperands(allOperands, Loc, ReturnType), - Name(Name), Substitutions(Subs), numNormalOperands(numNormalOperands) {} + Name(Name), Substitutions(Subs.getCanonical()), numNormalOperands(numNormalOperands) {} IncrementProfilerCounterInst *IncrementProfilerCounterInst::create( SILDebugLocation Loc, unsigned CounterIdx, StringRef PGOFuncName, @@ -3176,7 +3176,7 @@ KeyPathInst::KeyPathInst(SILDebugLocation Loc, Pattern(Pattern), numPatternOperands(numPatternOperands), numTypeDependentOperands(allOperands.size() - numPatternOperands), - Substitutions(Subs) + Substitutions(Subs.getCanonical()) { assert(allOperands.size() >= numPatternOperands); auto *operandsBuf = getTrailingObjects(); diff --git a/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift b/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift index 9c78e70982301..7a380f1ca8571 100644 --- a/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift +++ b/test/Concurrency/dynamic_checks_for_func_refs_in_preconcurrency_apis.swift @@ -64,7 +64,7 @@ import API // CHECK-NEXT: [[OPTIONAL_TEST:%.*]] = enum $Optional<@callee_guaranteed @substituted <τ_0_0> (@in_guaranteed τ_0_0) -> () for >>, #Optional.some!enumelt, [[CONVERTED_REABSTRACTED_TEST_REF]] : // CHECK-NEXT: // function_ref // CHECK-NEXT: [[COMPUTE_REF:%.*]] = function_ref @$s3API7computeyyyxcSglF : $@convention(thin) <τ_0_0> (@guaranteed Optional<@callee_guaranteed @substituted <τ_0_0> (@in_guaranteed τ_0_0) -> () for <τ_0_0>>) -> () -// CHECK-NEXT: {{.*}} = apply [[COMPUTE_REF]]([[OPTIONAL_TEST]]) : $@convention(thin) <τ_0_0> (@guaranteed Optional<@callee_guaranteed @substituted <τ_0_0> (@in_guaranteed τ_0_0) -> () for <τ_0_0>>) -> () +// CHECK-NEXT: {{.*}} = apply [[COMPUTE_REF]]>([[OPTIONAL_TEST]]) : $@convention(thin) <τ_0_0> (@guaranteed Optional<@callee_guaranteed @substituted <τ_0_0> (@in_guaranteed τ_0_0) -> () for <τ_0_0>>) -> () @MainActor func testMainActorContext() { compute(test) // no warning diff --git a/test/SILGen/dynamic_self.swift b/test/SILGen/dynamic_self.swift index c437432dd4204..f69ec350f9511 100644 --- a/test/SILGen/dynamic_self.swift +++ b/test/SILGen/dynamic_self.swift @@ -69,7 +69,7 @@ func testDynamicSelfDispatchGeneric(gy: GY) { // CHECK: bb0([[GY:%[0-9]+]] : @guaranteed $GY): // CHECK: [[GY_AS_GX:%[0-9]+]] = upcast [[GY]] : $GY to $GX> // CHECK: [[GX_F:%[0-9]+]] = class_method [[GY_AS_GX]] : $GX>, #GX.f : (GX) -> () -> @dynamic_self GX, $@convention(method) <τ_0_0> (@guaranteed GX<τ_0_0>) -> @owned GX<τ_0_0> - // CHECK: [[GX_RESULT:%[0-9]+]] = apply [[GX_F]]<[Int]>([[GY_AS_GX]]) : $@convention(method) <τ_0_0> (@guaranteed GX<τ_0_0>) -> @owned GX<τ_0_0> + // CHECK: [[GX_RESULT:%[0-9]+]] = apply [[GX_F]]>([[GY_AS_GX]]) : $@convention(method) <τ_0_0> (@guaranteed GX<τ_0_0>) -> @owned GX<τ_0_0> // CHECK: [[GY_RESULT:%[0-9]+]] = unchecked_ref_cast [[GX_RESULT]] : $GX> to $GY // CHECK: destroy_value [[GY_RESULT]] : $GY _ = gy.f() diff --git a/test/SILGen/foreach.swift b/test/SILGen/foreach.swift index 1a26e6c4db80c..8a16840653184 100644 --- a/test/SILGen/foreach.swift +++ b/test/SILGen/foreach.swift @@ -111,14 +111,14 @@ func trivialStructBreak(_ xx: [Int]) { // CHECK: [[BORROWED_ARRAY_STACK:%.*]] = alloc_stack $Array // CHECK: store [[ARRAY_COPY:%.*]] to [init] [[BORROWED_ARRAY_STACK]] // CHECK: [[MAKE_ITERATOR_FUNC:%.*]] = function_ref @$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection, τ_0_0.Iterator == IndexingIterator<τ_0_0>> (@in τ_0_0) -> @out IndexingIterator<τ_0_0> -// CHECK: apply [[MAKE_ITERATOR_FUNC]]<[Int]>([[PROJECT_ITERATOR_BOX]], [[BORROWED_ARRAY_STACK]]) +// CHECK: apply [[MAKE_ITERATOR_FUNC]]>([[PROJECT_ITERATOR_BOX]], [[BORROWED_ARRAY_STACK]]) // CHECK: br [[LOOP_DEST:bb[0-9]+]] // // CHECK: [[LOOP_DEST]]: // CHECK: [[GET_ELT_STACK:%.*]] = alloc_stack $Optional // CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PROJECT_ITERATOR_BOX]] : $*IndexingIterator> // CHECK: [[FUNC_REF:%.*]] = function_ref @$ss16IndexingIteratorV4next7ElementQzSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection> (@inout IndexingIterator<τ_0_0>) -> @out Optional<τ_0_0.Element> -// CHECK: apply [[FUNC_REF]]<[Int]>([[GET_ELT_STACK]], [[WRITE]]) +// CHECK: apply [[FUNC_REF]]>([[GET_ELT_STACK]], [[WRITE]]) // CHECK: [[IND_VAR:%.*]] = load [trivial] [[GET_ELT_STACK]] // CHECK: switch_enum [[IND_VAR]] : $Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[NONE_BB:bb[0-9]+]] // @@ -212,14 +212,14 @@ func existentialBreak(_ xx: [P]) { // CHECK: [[BORROWED_ARRAY_STACK:%.*]] = alloc_stack $Array // CHECK: store [[ARRAY_COPY:%.*]] to [init] [[BORROWED_ARRAY_STACK]] // CHECK: [[MAKE_ITERATOR_FUNC:%.*]] = function_ref @$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection, τ_0_0.Iterator == IndexingIterator<τ_0_0>> (@in τ_0_0) -> @out IndexingIterator<τ_0_0> -// CHECK: apply [[MAKE_ITERATOR_FUNC]]<[any P]>([[PROJECT_ITERATOR_BOX]], [[BORROWED_ARRAY_STACK]]) +// CHECK: apply [[MAKE_ITERATOR_FUNC]]>([[PROJECT_ITERATOR_BOX]], [[BORROWED_ARRAY_STACK]]) // CHECK: [[ELT_STACK:%.*]] = alloc_stack $Optional // CHECK: br [[LOOP_DEST:bb[0-9]+]] // // CHECK: [[LOOP_DEST]]: // CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PROJECT_ITERATOR_BOX]] : $*IndexingIterator> // CHECK: [[FUNC_REF:%.*]] = function_ref @$ss16IndexingIteratorV4next7ElementQzSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection> (@inout IndexingIterator<τ_0_0>) -> @out Optional<τ_0_0.Element> -// CHECK: apply [[FUNC_REF]]<[any P]>([[ELT_STACK]], [[WRITE]]) +// CHECK: apply [[FUNC_REF]]>([[ELT_STACK]], [[WRITE]]) // CHECK: switch_enum_addr [[ELT_STACK]] : $*Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[NONE_BB:bb[0-9]+]] // // CHECK: [[SOME_BB]]: @@ -373,14 +373,14 @@ func genericStructBreak(_ xx: [GenericStruct]) { // CHECK: [[BORROWED_ARRAY_STACK:%.*]] = alloc_stack $Array> // CHECK: store [[ARRAY_COPY:%.*]] to [init] [[BORROWED_ARRAY_STACK]] // CHECK: [[MAKE_ITERATOR_FUNC:%.*]] = function_ref @$sSlss16IndexingIteratorVyxG0B0RtzrlE04makeB0ACyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection, τ_0_0.Iterator == IndexingIterator<τ_0_0>> (@in τ_0_0) -> @out IndexingIterator<τ_0_0> -// CHECK: apply [[MAKE_ITERATOR_FUNC]]<[GenericStruct]>([[PROJECT_ITERATOR_BOX]], [[BORROWED_ARRAY_STACK]]) +// CHECK: apply [[MAKE_ITERATOR_FUNC]]>>([[PROJECT_ITERATOR_BOX]], [[BORROWED_ARRAY_STACK]]) // CHECK: [[ELT_STACK:%.*]] = alloc_stack $Optional> // CHECK: br [[LOOP_DEST:bb[0-9]+]] // // CHECK: [[LOOP_DEST]]: // CHECK: [[WRITE:%.*]] = begin_access [modify] [unknown] [[PROJECT_ITERATOR_BOX]] : $*IndexingIterator>> // CHECK: [[FUNC_REF:%.*]] = function_ref @$ss16IndexingIteratorV4next7ElementQzSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection> (@inout IndexingIterator<τ_0_0>) -> @out Optional<τ_0_0.Element> -// CHECK: apply [[FUNC_REF]]<[GenericStruct]>([[ELT_STACK]], [[WRITE]]) +// CHECK: apply [[FUNC_REF]]>>([[ELT_STACK]], [[WRITE]]) // CHECK: switch_enum_addr [[ELT_STACK]] : $*Optional>, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[NONE_BB:bb[0-9]+]] // // CHECK: [[SOME_BB]]: diff --git a/test/SILGen/foreach_async.swift b/test/SILGen/foreach_async.swift index 918802c243867..ac48e3ad14020 100644 --- a/test/SILGen/foreach_async.swift +++ b/test/SILGen/foreach_async.swift @@ -84,7 +84,7 @@ struct AsyncLazySequence: AsyncSequence { // CHECK: [[MUTATION:%.*]] = begin_access // CHECK: [[WITNESS_METHOD:%.*]] = function_ref @$sScIsE4next9isolation7ElementQzSgScA_pSgYi_tYa7FailureQzYKF : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure) // CHECK: [[ERROR_SLOT:%[0-9]+]] = alloc_stack $Never -// CHECK: try_apply [[WITNESS_METHOD]].Iterator>([[NEXT_RESULT]], [[ERROR_SLOT]], [[ACTOR]], [[MUTATION]]) : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure), normal [[NORMAL_BB:bb[0-2]+]], error [[ERROR_BB:bb[0-9]+]] +// CHECK: try_apply [[WITNESS_METHOD]]>.Iterator>([[NEXT_RESULT]], [[ERROR_SLOT]], [[ACTOR]], [[MUTATION]]) : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure), normal [[NORMAL_BB:bb[0-2]+]], error [[ERROR_BB:bb[0-9]+]] // CHECK: [[NORMAL_BB]]( // CHECK: end_access [[MUTATION]] // CHECK: switch_enum [[IND_VAR:%.*]] : $Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[NONE_BB:bb[0-9]+]] @@ -117,7 +117,7 @@ func trivialStruct(_ xx: AsyncLazySequence<[Int]>) async { // CHECK: [[MUTATION:%.*]] = begin_access // CHECK: [[WITNESS_METHOD:%.*]] = function_ref @$sScIsE4next9isolation7ElementQzSgScA_pSgYi_tYa7FailureQzYKF : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure) // CHECK: [[ERROR_SLOT:%[0-9]+]] = alloc_stack $Never -// CHECK: try_apply [[WITNESS_METHOD]].Iterator>([[NEXT_RESULT]], [[ERROR_SLOT]], [[ACTOR]], [[MUTATION]]) : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure), normal [[NORMAL_BB:bb[0-2]+]], error [[ERROR_BB:bb[0-9]+]] +// CHECK: try_apply [[WITNESS_METHOD]]>.Iterator>([[NEXT_RESULT]], [[ERROR_SLOT]], [[ACTOR]], [[MUTATION]]) : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure), normal [[NORMAL_BB:bb[0-2]+]], error [[ERROR_BB:bb[0-9]+]] // CHECK: [[NORMAL_BB]]( // CHECK: end_access [[MUTATION]] // CHECK: switch_enum [[IND_VAR:%.*]] : $Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[NONE_BB:bb[0-9]+]] @@ -177,7 +177,7 @@ func trivialStructBreak(_ xx: AsyncLazySequence<[Int]>) async { // CHECK: [[MUTATION:%.*]] = begin_access // CHECK: [[WITNESS_METHOD:%.*]] = function_ref @$sScIsE4next9isolation7ElementQzSgScA_pSgYi_tYa7FailureQzYKF : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure) // CHECK: [[ERROR_SLOT:%[0-9]+]] = alloc_stack $Never -// CHECK: try_apply [[WITNESS_METHOD]].Iterator>([[NEXT_RESULT]], [[ERROR_SLOT]], [[ACTOR]], [[MUTATION]]) : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure), normal [[NORMAL_BB:bb[0-2]+]], error [[ERROR_BB:bb[0-9]+]] +// CHECK: try_apply [[WITNESS_METHOD]]>.Iterator>([[NEXT_RESULT]], [[ERROR_SLOT]], [[ACTOR]], [[MUTATION]]) : $@convention(method) @async <τ_0_0 where τ_0_0 : AsyncIteratorProtocol> (@sil_isolated @guaranteed Optional, @inout τ_0_0) -> (@out Optional<τ_0_0.Element>, @error_indirect τ_0_0.Failure), normal [[NORMAL_BB:bb[0-2]+]], error [[ERROR_BB:bb[0-9]+]] // CHECK: [[NORMAL_BB]]( // CHECK: end_access [[MUTATION]] // CHECK: switch_enum [[IND_VAR:%.*]] : $Optional, case #Optional.some!enumelt: [[SOME_BB:bb[0-9]+]], case #Optional.none!enumelt: [[NONE_BB:bb[0-9]+]] diff --git a/test/SILGen/init_delegation_optional.swift b/test/SILGen/init_delegation_optional.swift index 385977177249f..ea0020dcc1a19 100644 --- a/test/SILGen/init_delegation_optional.swift +++ b/test/SILGen/init_delegation_optional.swift @@ -369,7 +369,7 @@ extension Optional where Wrapped == Optional { // CHECK-NEXT: [[PB:%[0-9]+]] = project_box [[MARKED_SELF_LIFETIME]] // CHECK: [[RESULT_ADDR:%[0-9]+]] = alloc_stack $Optional> // CHECK: [[DELEG_INIT:%[0-9]+]] = function_ref @$sSq24init_delegation_optionalE12nonFailable1xSgyt_tcfC - // CHECK-NEXT: apply [[DELEG_INIT]]([[RESULT_ADDR]], [[SELF_META]]) + // CHECK-NEXT: apply [[DELEG_INIT]]>([[RESULT_ADDR]], [[SELF_META]]) // CHECK-NEXT: [[RESULT:%[0-9]+]] = load [trivial] [[RESULT_ADDR]] // CHECK-NEXT: assign [[RESULT]] to [[PB]] // CHECK-NEXT: dealloc_stack [[RESULT_ADDR]] diff --git a/test/SILGen/objc_bridging.swift b/test/SILGen/objc_bridging.swift index ec1e5a6bc9da6..79605f7664880 100644 --- a/test/SILGen/objc_bridging.swift +++ b/test/SILGen/objc_bridging.swift @@ -630,7 +630,7 @@ func castToCFunction(ptr: UnsafeRawPointer) { // CHECK: store %0 to [trivial] [[IN]] : $*UnsafeRawPointer // CHECK: [[META:%.*]] = metatype $@thick (@convention(c) (Optional) -> ()).Type // CHECK: [[CASTFN:%.*]] = function_ref @$ss13unsafeBitCast_2toq_x_q_mtr0_lF - // CHECK: apply [[CASTFN]] ()>([[OUT]], [[IN]], [[META]]) : $@convention(thin) <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0, @thick τ_0_1.Type) -> @out τ_0_1 + // CHECK: apply [[CASTFN]]) -> ()>([[OUT]], [[IN]], [[META]]) : $@convention(thin) <τ_0_0, τ_0_1> (@in_guaranteed τ_0_0, @thick τ_0_1.Type) -> @out τ_0_1 // CHECK: [[RESULT:%.*]] = load [trivial] [[OUT]] : $*@convention(c) (Optional) -> () typealias Fn = @convention(c) (AnyObject?) -> Void unsafeBitCast(ptr, to: Fn.self)(nil) diff --git a/test/SILGen/opaque_result_type_nested_optional.swift b/test/SILGen/opaque_result_type_nested_optional.swift index 0ec92953a6cde..95ab112b62ea5 100644 --- a/test/SILGen/opaque_result_type_nested_optional.swift +++ b/test/SILGen/opaque_result_type_nested_optional.swift @@ -11,5 +11,5 @@ _ = bar(foo()) // CHECK: [[UNUSED:%.*]] = alloc_stack $S> // CHECK: [[INNER:%.*]] = alloc_stack $S> // CHECK: [[FN:%.*]] = function_ref @$s40opaque_result_type_nested_optional_other3bary1AQzxAA1PRzlF : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @out τ_0_0.A -// CHECK: apply [[FN]]>([[OUTER]], [[INNER]]) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @out τ_0_0.A +// CHECK: apply [[FN]]>>([[OUTER]], [[INNER]]) : $@convention(thin) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> @out τ_0_0.A // CHECK: return diff --git a/test/SILGen/statements.swift b/test/SILGen/statements.swift index b9b3882da5c88..496e1c309cfd4 100644 --- a/test/SILGen/statements.swift +++ b/test/SILGen/statements.swift @@ -168,7 +168,7 @@ func for_loops2() { // CHECK: alloc_stack $Optional // CHECK-NEXT: [[WRITE:%.*]] = begin_access [modify] [unknown] // CHECK: [[NEXT:%[0-9]+]] = function_ref @$ss16IndexingIteratorV4next7ElementQzSgyF : $@convention(method) <τ_0_0 where τ_0_0 : Collection> (@inout IndexingIterator<τ_0_0>) -> @out Optional<τ_0_0.Element> - // CHECK-NEXT: apply [[NEXT]]<[MyClass]> + // CHECK-NEXT: apply [[NEXT]]> let objects = [MyClass(), MyClass() ] for obj in objects { obj.foo() diff --git a/test/SILOptimizer/access_marker_verify.swift b/test/SILOptimizer/access_marker_verify.swift index fb0f24e90c0f5..e496a33828af2 100644 --- a/test/SILOptimizer/access_marker_verify.swift +++ b/test/SILOptimizer/access_marker_verify.swift @@ -498,7 +498,7 @@ func accessOptionalArray(_ dict : MyDict) { // CHECK: store %{{.*}} to [trivial] // ----- Call MyDict.subscript.getter. // CHECK-NOT: begin_access -// CHECK: apply %{{.*}} +// CHECK: apply %{{.*}}> // ----- access the temporary array result of the getter // CHECK: [[TEMPACCESS:%.*]] = begin_access [modify] [unsafe] [[TEMP]] // CHECK: [[HAS_VALUE:%.*]] = select_enum_addr [[TEMPACCESS]] @@ -518,7 +518,7 @@ func accessOptionalArray(_ dict : MyDict) { // CHECK: alloc_stack $Int // CHECK: store %{{.*}} to [trivial] // ----- call MyDict.subscript.setter -// CHECK: apply %{{.*}}([[ARRAYCOPY]], %{{.*}}, [[BOXACCESS]]) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in Optional<τ_0_1>, @in τ_0_0, @inout MyDict<τ_0_0, τ_0_1>) -> () +// CHECK: apply %{{.*}}>([[ARRAYCOPY]], %{{.*}}, [[BOXACCESS]]) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in Optional<τ_0_1>, @in τ_0_0, @inout MyDict<τ_0_0, τ_0_1>) -> () // CHECK: br [[RETBB:bb[0-9]+]] // // CHECK: [[FALSEBB]]: @@ -530,7 +530,7 @@ func accessOptionalArray(_ dict : MyDict) { // CHECK-NOT: begin_access // CHECK: store %{{.*}} to [trivial] [[TEMP3]] : $*Int // Call MyDict.subscript.setter -// CHECK: apply %{{.*}}([[WRITEBACK]], [[TEMP3]], [[BOXACCESS]]) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in Optional<τ_0_1>, @in τ_0_0, @inout MyDict<τ_0_0, τ_0_1>) -> () +// CHECK: apply %{{.*}}>([[WRITEBACK]], [[TEMP3]], [[BOXACCESS]]) : $@convention(method) <τ_0_0, τ_0_1 where τ_0_0 : Hashable> (@in Optional<τ_0_1>, @in τ_0_0, @inout MyDict<τ_0_0, τ_0_1>) -> () // CHECK: end_access [[TEMPACCESS]] : $*Optional> // CHECK: end_access [[BOXACCESS]] : $*MyDict> // CHECK: br [[RETBB]] diff --git a/test/Serialization/clang-function-types.swift b/test/Serialization/clang-function-types.swift index 61d0ff0a628be..01016e4ccc71d 100644 --- a/test/Serialization/clang-function-types.swift +++ b/test/Serialization/clang-function-types.swift @@ -25,5 +25,5 @@ func test2() { // CHECK-LABEL: sil public_external [canonical] @$s24def_clang_function_types17use_fp_internallyyyF // CHECK: enum $Optional<@convention(c, cType: "struct ForwardInTypedefForFP2 *(*)(void)") () -> Optional>, #Optional.none!enumelt // CHECK: [[FN:%.*]] = function_ref @$s24def_clang_function_types9use_inout3argyxz_tlF : $@convention(thin) <τ_0_0> (@inout τ_0_0) -> () -// CHECK: apply [[FN]]<(@convention(c, cType: "OpaqueTypedefForFP2 (*)(void)") () -> OpaquePointer?)?> +// CHECK: apply [[FN]] Optional>> // CHECK-LABEL: } // end sil function '$s24def_clang_function_types17use_fp_internallyyyF' diff --git a/test/embedded/generic-specialization.swift b/test/embedded/generic-specialization.swift new file mode 100644 index 0000000000000..03b97b45a6215 --- /dev/null +++ b/test/embedded/generic-specialization.swift @@ -0,0 +1,13 @@ +// RUN: %target-run-simple-swift( -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none) | %FileCheck %s +// RUN: %target-run-simple-swift(-O -enable-experimental-feature Embedded -wmo -runtime-compatibility-version none) | %FileCheck %s + +// REQUIRES: executable_test +// REQUIRES: swift_feature_Embedded + +func f(_ a: [V]) -> [String] { + return a.indices.map { String($0 /* as Int*/) } // adding `as Int` makes it compile +} + +// CHECK: 0 +print(f(["A"]).joined()) + diff --git a/validation-test/compiler_crashers_2_fixed/0144-issue-49620.swift b/validation-test/compiler_crashers_2_fixed/0144-issue-49620.swift index ac13b1d38d3f1..f03131dbc0a8d 100644 --- a/validation-test/compiler_crashers_2_fixed/0144-issue-49620.swift +++ b/validation-test/compiler_crashers_2_fixed/0144-issue-49620.swift @@ -28,6 +28,6 @@ class Bar: Cl { // CHECK-LABEL: sil hidden @$s4main5crash4barsSbAA8GenClassCyAA3BarCG_tF func crash(bars: GenClass) -> Bool { - // CHECK: apply [[FN:%.*]] + // CHECK: apply [[FN:%.*]]> return Array(bars.filter { $0.x == nil }).isEmpty }