mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This attribute was introduced in 7eca38ce76d5d1915f4ab7e665964062c0b37697 (llvm-project). Match it using a wildcard regex, since it is not relevant to these tests. This is intended to reduce future conflicts with rebranch.
20 lines
960 B
Swift
20 lines
960 B
Swift
// RUN: %target-swift-frontend -primary-file %s %S/Inputs/witness_table_multifile_2.swift -emit-ir -disable-objc-attr-requires-foundation-module | %FileCheck %s
|
|
|
|
// CHECK: [[P_WITNESS_TABLE:%[A-Za-z0-9_]+]] = type { [{{24|12}} x i8], ptr, ptr }
|
|
|
|
// CHECK-LABEL: define hidden swiftcc void @"$s23witness_table_multifile3baryyF"
|
|
func bar() {
|
|
// CHECK: call swiftcc void @"$s23witness_table_multifile2goAA1P_pyF"
|
|
// CHECK: [[WITNESS_TABLE_ADDR:%[0-9]+]] = getelementptr inbounds{{.*}} [[P_WITNESS_TABLE]], ptr %0, i32 0, i32 2
|
|
// CHECK: [[WITNESS_TABLE:%[A-Za-z0-9_-]+]] = load ptr, ptr [[WITNESS_TABLE_ADDR]]
|
|
// CHECK: [[BUFFER:%[0-9]+]] = call ptr @__swift_project_boxed_opaque_existential_1
|
|
// CHECK-NEXT: getelementptr inbounds ptr, ptr [[WITNESS_TABLE]], i32 4
|
|
go().foo()
|
|
}
|
|
|
|
// Ensure that protocols from other files get fully validated even
|
|
// when they're only used as types.
|
|
func useAProtocol() -> ProtocolOnlyUsedAsAType? {
|
|
return nil
|
|
}
|