Files
swift-mirror/test/IRGen/signature_conformances_multifile.swift
Alex Lorenz 4858cb6225 [IRGen][interop] do not add 'nocapture' to not bitwise takable types
The use of 'nocapture' for parameters and return values is incorrect for C++ types, as they can actually capture a pointer into its own value (e.g. std::string in libstdc++)

rdar://115062687
2023-09-25 17:43:34 -07:00

27 lines
1.4 KiB
Swift

// RUN: %target-swift-frontend -disable-generic-metadata-prespecialization -emit-ir -primary-file %s %S/Inputs/signature_conformances_other.swift | %FileCheck %s
// Make sure we correctly determine the witness table is dependent, even though
// it was defined in a different file.
// CHECK-LABEL: define hidden swiftcc void @"$s32signature_conformances_multifile5passQyyF"()
func passQ() {
// CHECK: call swiftcc void @"$s32signature_conformances_multifile12AlsoConformsVACyxGycfC"(ptr @"$sSiN")
// CHECK: %0 = call {{.*}} @"$s32signature_conformances_multifile12AlsoConformsVySiGMD"
// CHECK: %1 = call ptr @"$s32signature_conformances_multifile12AlsoConformsVySiGACyxGAA1QAAWl"()
// CHECK: call swiftcc void @"$s32signature_conformances_multifile6takesQyyxAA1QRzlF"(ptr noalias undef, ptr %0, ptr %1)
takesQ(AlsoConforms<Int>())
// CHECK: ret void
}
// CHECK-LABEL: define hidden swiftcc void @"$s32signature_conformances_multifile5passPyyF"()
func passP() {
// CHECK: call swiftcc void @"$s32signature_conformances_multifile8ConformsVACyxq_GycfC"(ptr @"$sSiN", ptr @"$sSSN")
// CHECK: %0 = call {{.*}} @"$s32signature_conformances_multifile8ConformsVySiSSGMD"
// CHECK: %1 = call ptr @"$s32signature_conformances_multifile8ConformsVySiSSGACyxq_GAA1PAAWl"()
// CHECK: call swiftcc void @"$s32signature_conformances_multifile6takesPyyxAA1PRzlF"(ptr noalias undef, ptr %0, ptr %1)
takesP(Conforms<Int, String>())
// CHECK: ret void
}