mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Runtime][ABI] Fix up additional tests for the swift_willThrow ABI change.
rdar://problem/37578477
This commit is contained in:
@@ -11,7 +11,7 @@ enum MyError : Error {
|
||||
// thrown error we create a shadow stack location holding the address of the
|
||||
// location that holds the pointer to the error instead.
|
||||
func simple(_ placeholder: Int64) throws -> () {
|
||||
// CHECK: define {{.*}}void @"$S8ErrorVar6simpleyys5Int64VKF"(i64, %swift.refcounted* swiftself, %swift.error**)
|
||||
// CHECK: define {{.*}}void @"$S8ErrorVar6simpleyys5Int64VKF"(i64, %swift.refcounted* swiftself, %swift.error** noalias nocapture dereferenceable(4))
|
||||
// CHECK: call void @llvm.dbg.declare
|
||||
// CHECK: call void @llvm.dbg.declare({{.*}}, metadata ![[ERROR:[0-9]+]], metadata !DIExpression(DW_OP_deref))
|
||||
// CHECK: ![[ERRTY:.*]] = !DICompositeType({{.*}}identifier: "$Ss5Error_pD"
|
||||
|
||||
@@ -451,12 +451,12 @@ class Foo {
|
||||
// x86_64-macosx: call signext i8 bitcast (void ()* @objc_msgSend to i8 (%1*, i8*, i8, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i8 signext {{%[0-9]+}}, %2** {{%[0-9]+}})
|
||||
// x86_64-macosx: }
|
||||
|
||||
// x86_64-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** swifterror) {{.*}} {
|
||||
// x86_64-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** noalias nocapture swifterror dereferenceable(8)) {{.*}} {
|
||||
// x86_64-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 8
|
||||
// x86_64-ios: call zeroext i1 bitcast (void ()* @objc_msgSend to i1 (%1*, i8*, i1, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i1 zeroext {{%[0-9]+}}, %2** {{%[0-9]+}})
|
||||
// x86_64-ios: }
|
||||
|
||||
// i386-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error**) {{.*}} {
|
||||
// i386-ios: define hidden swiftcc void @"$S8abitypes3FooC10throwsTestyySbKF"(i1, %T8abitypes3FooC* swiftself, %swift.error** noalias nocapture dereferenceable(4)) {{.*}} {
|
||||
// i386-ios: [[SEL:%[0-9]+]] = load i8*, i8** @"\01L_selector(negateThrowing:error:)", align 4
|
||||
// i386-ios: call signext i8 bitcast (void ()* @objc_msgSend to i8 (%1*, i8*, i8, %2**)*)(%1* {{%[0-9]+}}, i8* [[SEL]], i8 signext {{%[0-9]+}}, %2** {{%[0-9]+}})
|
||||
// i386-ios: }
|
||||
|
||||
@@ -335,11 +335,11 @@ public extension sr8076_QueryHandler {
|
||||
}
|
||||
|
||||
// CHECK-LABEL-64: define{{( dllexport)?}}{{( protected)?}} swiftcc { i64, i64 } @"$S22big_types_corner_cases19sr8076_QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0e1_F0Rd__lF"(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type*{{.*}}, %swift.type*{{.*}}, i8** {{.*}}.sr8076_QueryHandler, i8** {{.*}}.sr8076_Query, %swift.opaque* noalias nocapture swiftself, %swift.error** swifterror)
|
||||
// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** nocapture swifterror {{.*}})
|
||||
// CHECK-64: {{.*}} = call swiftcc { i64, i64 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** noalias nocapture swifterror {{.*}})
|
||||
// CHECK-64: ret { i64, i64 }
|
||||
|
||||
// CHECK-LABEL-32: define{{( dllexport)?}}{{( protected)?}} swiftcc { i32, i32} @"$S22big_types_corner_cases19sr8076_QueryHandlerPAAE13forceHandle_45query8ReturnedQyd___SbAA9BigStructVcSgtqd___tKAA0e1_F0Rd__lF"(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type*{{.*}}, %swift.type*{{.*}}, i8** {{.*}}.sr8076_QueryHandler, i8** {{.*}}.sr8076_Query, %swift.opaque* noalias nocapture swiftself, %swift.error** swifterror)
|
||||
// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** nocapture {{.*}})
|
||||
// CHECK-32: {{.*}} = call swiftcc { i32, i32 } {{.*}}(%swift.opaque* noalias nocapture {{.*}}, %swift.opaque* noalias nocapture {{.*}}, %swift.refcounted* swiftself {{.*}}, %swift.error** noalias nocapture {{.*}})
|
||||
// CHECK-32: ret { i32, i32 }
|
||||
func forceHandle_4<Q: sr8076_Query>(query: Q) throws -> (Q.Returned, sr8076_Filter?) {
|
||||
guard let body = handle_4 as? (Q) throws -> (Q.Returned, sr8076_Filter?) else {
|
||||
|
||||
@@ -65,7 +65,7 @@ entry(%0 : $AnyObject):
|
||||
// CHECK-aarch64: [[ERRORSLOT:%.*]] = alloca [[SWIFTERROR:.*]] %swift.error*, align
|
||||
// CHECK-NEXT: store %swift.error* null, %swift.error** [[ERRORSLOT]], align
|
||||
|
||||
// CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc %objc_object* @try_apply_helper(%objc_object* %0, %swift.refcounted* swiftself undef, %swift.error** noalias nocapture [[SWIFTERROR]] dereferenceable(8){{( )?}}[[ERRORSLOT]])
|
||||
// CHECK-objc-NEXT: [[RESULT:%.*]] = call swiftcc %objc_object* @try_apply_helper(%objc_object* %0, %swift.refcounted* swiftself undef, %swift.error** noalias nocapture [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) [[ERRORSLOT]])
|
||||
// CHECK-native-NEXT: [[RESULT:%.*]] = call swiftcc %swift.refcounted* @try_apply_helper(%swift.refcounted* %0, %swift.refcounted* swiftself undef, %swift.error** nocapture [[SWIFTERROR]]{{( )?}}[[ERRORSLOT]])
|
||||
// CHECK-NEXT: [[ERR:%.*]] = load %swift.error*, %swift.error** [[ERRORSLOT]], align
|
||||
// CHECK-NEXT: [[T0:%.*]] = icmp ne %swift.error* [[ERR]], null
|
||||
@@ -101,7 +101,7 @@ enum ColorError : Error {
|
||||
}
|
||||
|
||||
// CHECK-LABEL: TestCallToWillThrowCallBack
|
||||
// CHECK: call swiftcc void @swift_willThrow(i8* swiftself undef, %swift.error** noalias nocapture readonly swifterror dereferenceable(8) %2)
|
||||
// CHECK: call swiftcc void @swift_willThrow(i8* swiftself undef, %swift.error** noalias nocapture readonly [[SWIFTERROR]]{{( )?}}dereferenceable({{.}}) %2)
|
||||
// CHECK: store %swift.error* %0
|
||||
// CHECK: ret i64 undef
|
||||
sil hidden @TestCallToWillThrowCallBack : $@convention(thin) (@owned Error) -> (Int64, @error Error) {
|
||||
@@ -114,9 +114,9 @@ bb0(%0 : $Error):
|
||||
|
||||
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc { i8*, %swift.refcounted* } @partial_apply_single(%T6errors1AC*)
|
||||
// CHECK: insertvalue { i8*, %swift.refcounted* } { i8* bitcast (void (%swift.refcounted*, %swift.error**)* @"$S27partial_apply_single_helperTA" to i8*), %swift.refcounted* undef },
|
||||
// CHECK: define internal swiftcc void @"$S27partial_apply_single_helperTA"(%swift.refcounted* swiftself, %swift.error** noalias nocapture{{( )?}}[[SWIFTERROR]]{{( )?}}dereferenceable(8))
|
||||
// CHECK: define internal swiftcc void @"$S27partial_apply_single_helperTA"(%swift.refcounted* swiftself, %swift.error** noalias nocapture{{( )?}}[[SWIFTERROR]]{{( )?}}dereferenceable({{.}}))
|
||||
// CHECK: [[T0:%.*]] = bitcast %swift.refcounted* {{%.*}} to %T6errors1AC*
|
||||
// CHECK-NEXT: tail call swiftcc void @partial_apply_single_helper(%T6errors1AC* [[T0]], %swift.refcounted* swiftself undef, %swift.error** noalias nocapture{{( )?}}[[SWIFTERROR]]{{( )?}}dereferenceable(8){{( )?}}{{%.*}})
|
||||
// CHECK-NEXT: tail call swiftcc void @partial_apply_single_helper(%T6errors1AC* [[T0]], %swift.refcounted* swiftself undef, %swift.error** noalias nocapture{{( )?}}[[SWIFTERROR]]{{( )?}}dereferenceable({{.}}){{( )?}}{{%.*}})
|
||||
// CHECK-NEXT: ret void
|
||||
sil @partial_apply_single : $@convention(thin) (@owned A) -> @callee_owned () -> @error Error {
|
||||
entry(%0 : $A):
|
||||
|
||||
@@ -48,11 +48,11 @@ public protocol MyResilientProtocol {
|
||||
// CHECK-NEXT: call swiftcc void [[FN]](%Any* noalias nocapture sret %0, %swift.opaque* noalias nocapture swiftself %1, %swift.type* %2, i8** %3)
|
||||
// CHECK-NEXT: ret void
|
||||
|
||||
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$S26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(%swift.opaque* noalias nocapture swiftself, %swift.error**{{( noalias nocapture swifterror dereferenceable\(8\))?}}, %swift.type*, i8**)
|
||||
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$S26protocol_resilience_thunks19MyResilientProtocolP12throwingFuncyyKFTj"(%swift.opaque* noalias nocapture swiftself, %swift.error**{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}}, %swift.type*, i8**)
|
||||
// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds i8*, i8** %3, i32 4
|
||||
// CHECK-NEXT: [[WITNESS:%.*]] = load i8*, i8** [[WITNESS_ADDR]]
|
||||
// CHECK-NEXT: [[FN:%.*]] = bitcast i8* [[WITNESS]] to void (%swift.opaque*, %swift.error**, %swift.type*, i8**)*
|
||||
// CHECK-NEXT: call swiftcc void [[FN]](%swift.opaque* noalias nocapture swiftself %0, %swift.error**{{( noalias nocapture swifterror dereferenceable\(8\))?}} %1, %swift.type* %2, i8** %3)
|
||||
// CHECK-NEXT: call swiftcc void [[FN]](%swift.opaque* noalias nocapture swiftself %0, %swift.error**{{( noalias nocapture( swifterror)? dereferenceable\(.\))?}} %1, %swift.type* %2, i8** %3)
|
||||
// CHECK-NEXT: ret void
|
||||
|
||||
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} swiftcc void @"$S26protocol_resilience_thunks19MyResilientProtocolP11genericFuncyqd__qd__lFTj"(%swift.opaque* noalias nocapture sret, %swift.opaque* noalias nocapture, %swift.type*, %swift.opaque* noalias nocapture swiftself, %swift.type*, i8**)
|
||||
|
||||
Reference in New Issue
Block a user