Skip to content

Commit 81909f2

Browse files
committed
[IRGen] Update IRGen test cases for swift_getWitnessTable().
1 parent dd154f6 commit 81909f2

15 files changed

+46
-127
lines changed

test/IRGen/associated_type_witness.swift

Lines changed: 9 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ protocol HasThreeAssocTypes {
3737
}
3838

3939
// Witness table access functions for Universal : P and Universal : Q.
40-
// CHECK-LABEL: define hidden i8** @"$s23associated_type_witness9UniversalVAA1PAAWa"()
41-
// CHECK: ret i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @"$s23associated_type_witness9UniversalVAA1PAAWP", i32 0, i32 0)
42-
// CHECK-LABEL: define hidden i8** @"$s23associated_type_witness9UniversalVAA1QAAWa"()
43-
// CHECK: ret i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @"$s23associated_type_witness9UniversalVAA1QAAWP", i32 0, i32 0)
40+
// CHECK-LABEL: define linkonce_odr hidden i8** @"$s23associated_type_witness9UniversalVAcA1PAAWl"
41+
// CHECK: call i8** @swift_getWitnessTable(%swift.protocol_conformance_descriptor* @"$s23associated_type_witness9UniversalVAA1PAAMc"
42+
// CHECK-LABEL: define linkonce_odr hidden i8** @"$s23associated_type_witness9UniversalVAcA1QAAWl"()
43+
// CHECK: call i8** @swift_getWitnessTable(%swift.protocol_conformance_descriptor* @"$s23associated_type_witness9UniversalVAA1QAAMc"
4444

4545
// Witness table for WithUniversal : Assocked.
4646
// GLOBAL-LABEL: @"$s23associated_type_witness13WithUniversalVAA8AssockedAAWP" = hidden global [4 x i8*] [
4747
// GLOBAL-SAME: @"$s23associated_type_witness13WithUniversalVAA8AssockedAAMc"
48-
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAA1PAAWa" to i8*)
49-
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAA1QAAWa" to i8*)
48+
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAcA1PAAWl" to i8*)
49+
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAcA1QAAWl" to i8*)
5050
// GLOBAL-SAME: i64 add (i64 ptrtoint (<{ [36 x i8], i8 }>* @"symbolic 23associated_type_witness9UniversalV" to i64), i64 1) to i8*)
5151
// GLOBAL-SAME: ]
5252
struct WithUniversal : Assocked {
@@ -56,8 +56,8 @@ struct WithUniversal : Assocked {
5656
// Witness table for GenericWithUniversal : Assocked.
5757
// GLOBAL-LABEL: @"$s23associated_type_witness20GenericWithUniversalVyxGAA8AssockedAAWP" = hidden global [4 x i8*] [
5858
// GLOBAL-SAME: @"$s23associated_type_witness20GenericWithUniversalVyxGAA8AssockedAAMc"
59-
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAA1PAAWa" to i8*)
60-
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAA1QAAWa" to i8*)
59+
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAcA1PAAWl" to i8*)
60+
// GLOBAL-SAME: i8* bitcast (i8** ()* @"$s23associated_type_witness9UniversalVAcA1QAAWl" to i8*)
6161
// GLOBAL-SAME: @"symbolic 23associated_type_witness9UniversalV"
6262
// GLOBAL-SAME: ]
6363
struct GenericWithUniversal<T> : Assocked {
@@ -105,24 +105,12 @@ struct Computed<T, U> : Assocked {
105105

106106
// Instantiation function for GenericComputed : DerivedFromSimpleAssoc.
107107
// CHECK-LABEL: define internal void @"$s23associated_type_witness15GenericComputedVyxGAA22DerivedFromSimpleAssocAAWI"(i8**, %swift.type* %"GenericComputed<T>", i8**)
108-
// CHECK: [[T0:%.*]] = call i8** @"$s23associated_type_witness15GenericComputedVyxGAA14HasSimpleAssocAAWa"(%swift.type* %"GenericComputed<T>", i8*** undef)
108+
// CHECK: [[T0:%.*]] = call i8** @swift_getWitnessTable({{.*}}@"$s23associated_type_witness15GenericComputedVyxGAA14HasSimpleAssocAAMc"
109109
// CHECK-NEXT: [[T1:%.*]] = bitcast i8** [[T0]] to i8*
110110
// CHECK-NEXT: [[T2:%.*]] = getelementptr inbounds i8*, i8** %0, i32 1
111111
// CHECK-NEXT: store i8* [[T1]], i8** [[T2]], align 8
112112
// CHECK-NEXT: ret void
113113

114-
// Witness table accessor function for GenericComputed : HasSimpleAssoc..
115-
// CHECK-LABEL: define hidden i8** @"$s23associated_type_witness15GenericComputedVyxGAA14HasSimpleAssocAAWa"(%swift.type*, i8***)
116-
// CHECK-NEXT: entry:
117-
// CHECK-NEXT: [[WTABLE:%.*]] = call i8** @swift_instantiateWitnessTable(%swift.protocol_conformance_descriptor* bitcast{{.*}}@"$s23associated_type_witness15GenericComputedVyxGAA14HasSimpleAssocAAMc"{{.*}}, %swift.type* %0, i8*** %1)
118-
// CHECK-NEXT: ret i8** [[WTABLE]]
119-
120-
// Witness table accessor function for Computed : Assocked.
121-
// CHECK-LABEL: define hidden i8** @"$s23associated_type_witness15GenericComputedVyxGAA22DerivedFromSimpleAssocAAWa"(%swift.type*, i8***)
122-
// CHECK-NEXT: entry:
123-
// CHECK-NEXT: [[WTABLE:%.*]] = call i8** @swift_instantiateWitnessTable(%swift.protocol_conformance_descriptor* bitcast{{.*}}@"$s23associated_type_witness15GenericComputedVyxGAA22DerivedFromSimpleAssocAAMc"{{.*}}, %swift.type* %0, i8*** %1)
124-
// CHECK-NEXT: ret i8** [[WTABLE]]
125-
126114

127115
struct PBox<T: P> {}
128116
protocol HasSimpleAssoc {
@@ -156,9 +144,6 @@ struct UsesVoid : HasSimpleAssoc {
156144
// GLOBAL-SAME: i16 4,
157145
// GLOBAL-SAME: i16 1,
158146

159-
// Relative reference to witness table template
160-
// GLOBAL-SAME: i32 trunc (i64 sub (i64 ptrtoint ([4 x i8*]* @"$s23associated_type_witness8ComputedVyxq_GAA8AssockedAAWp" to i64), i64 ptrtoint
161-
162147
// No instantiator function
163148
// GLOBAL-SAME: i32 0,
164149
// GLOBAL-SAME: i32 trunc (i64 sub (i64 ptrtoint ([16 x i8*]* [[PRIVATE:@.*]] to i64), i64 ptrtoint
@@ -169,8 +154,5 @@ struct UsesVoid : HasSimpleAssoc {
169154
// GLOBAL-SAME: i16 2,
170155
// GLOBAL-SAME: i16 0,
171156

172-
// Relative reference to witness table template
173-
// GLOBAL-SAME: i32 trunc (i64 sub (i64 ptrtoint ([2 x i8*]* @"$s23associated_type_witness15GenericComputedVyxGAA22DerivedFromSimpleAssocAAWp" to i64
174-
175157
// Relative reference to instantiator function
176158
// GLOBAL-SAME: i32 trunc (i64 sub (i64 ptrtoint (void (i8**, %swift.type*, i8**)* @"$s23associated_type_witness15GenericComputedVyxGAA22DerivedFromSimpleAssocAAWI" to i64),

test/IRGen/deserialize-clang-importer-witness-tables.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public func foo(line: String) {
99
// from the default argument expression passed to `RegEx(pattern:options:)`
1010
// below. Ensure that a local copy of the definition was deserialized
1111
// and lowered to IR.
12-
// CHECK-LABEL: define {{.*}} i8** @"$sSo26NSRegularExpressionOptionsVs10SetAlgebraSCWa"
1312
// CHECK-LABEL: define {{.*}} void @"$sSo26NSRegularExpressionOptionsVs10SetAlgebraSCsACPxycfCTW"
13+
// CHECK-LABEL: define {{.*}} i8** @"$sSo26NSRegularExpressionOptionsVABSQSCWl"()
1414
let versionRegex = try! RegEx(pattern: "Apple")
1515
_ = versionRegex.firstMatch(in: line)
1616
}

test/IRGen/objc_ns_enum.swift

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import gizmo
1111
// CHECK: @"$sSo16NSRuncingOptionsVMn" = linkonce_odr hidden constant
1212
// CHECK: @"$sSo16NSRuncingOptionsVN" = linkonce_odr hidden constant
1313
// CHECK-SAME: @"$sBi{{[0-9]+}}_WV"
14-
// CHECK: @"$sSo16NSRuncingOptionsVSQSCMc" = linkonce_odr hidden constant{{.*}}@"$sSo16NSRuncingOptionsVSQSCWa
14+
// CHECK: @"$sSo16NSRuncingOptionsVSQSCMc" = linkonce_odr hidden constant
1515
// CHECK-NOT: @"$sSo28NeverActuallyMentionedByNameVSQSCWp" = linkonce_odr hidden constant
1616

1717
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} i32 @main
@@ -89,11 +89,6 @@ use_metadata(NSRuncingOptions.mince)
8989
// CHECK-LABEL: define linkonce_odr hidden swiftcc %swift.metadata_response @"$sSo16NSRuncingOptionsVMa"(i64)
9090
// CHECK: call swiftcc %swift.metadata_response @swift_getForeignTypeMetadata([[INT]] %0, {{.*}} @"$sSo16NSRuncingOptionsVN" {{.*}}) [[NOUNWIND_READNONE:#[0-9]+]]
9191

92-
// CHECK-LABEL: define linkonce_odr hidden i8** @"$sSo16NSRuncingOptionsVSQSCWa"()
93-
// CHECK: [[NONUNIQUE:%.*]] = call i8** @swift_instantiateWitnessTable(%swift.protocol_conformance_descriptor* bitcast{{.*}}@"$sSo16NSRuncingOptionsVSQSCMc" to %swift.protocol_conformance_descriptor*), %swift.type* null, i8*** null)
94-
// CHECK: [[UNIQUE:%.*]] = call i8** @swift_getForeignWitnessTable(i8** [[NONUNIQUE]], %swift.type_descriptor* bitcast (<{ {{.*}} }>* @"$sSo16NSRuncingOptionsVMn" to %swift.type_descriptor*), %swift.protocol* @"$sSQMp")
95-
// CHECK: ret i8** [[UNIQUE]]
96-
9792
@objc enum ExportedToObjC: Int {
9893
case Foo = -1, Bar, Bas
9994
}

test/IRGen/partial_apply_forwarder.sil

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ sil hidden_external @takingEmptyAndQ : $@convention(thin) <τ_0_0 where τ_0_0
9898
// CHECK: [[GENPARAMSADDR:%.*]] = bitcast %swift.type* [[TY]] to %swift.type**
9999
// CHECK: [[PARAMTYADDR:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[GENPARAMSADDR]], {{(i64 10|i32 13)}}
100100
// CHECK: %"BaseProducer<\CF\84_0_1>" = load %swift.type*, %swift.type** [[PARAMTYADDR]]
101-
// CHECK: [[WITNESS:%.*]] = call i8** @"$s23partial_apply_forwarder12BaseProducerVyxGAA1QAAWa"(%swift.type* %"BaseProducer<\CF\84_0_1>", i8*** undef)
101+
// CHECK: [[WITNESS:%.*]] = call i8** @swift_getWitnessTable(
102102
// CHECK: [[OBJ:%.*]] = bitcast %swift.refcounted* %0 to %T23partial_apply_forwarder7WeakBoxC.1*
103103
// CHECK: tail call swiftcc void @takingQ(%T23partial_apply_forwarder7WeakBoxC.1* [[OBJ]], i8** [[WITNESS]])
104104
// CHECK: }
@@ -157,7 +157,7 @@ bb0(%0 : $*τ_0_1, %2: $EmptyType):
157157
// CHECK: [[TYPARAMSADDR:%.*]] = bitcast %swift.type* [[TY]] to %swift.type**
158158
// CHECK: [[TYPARAM:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[TYPARAMSADDR]], {{(i64 10|i32 13)}}
159159
// CHECK: %"BaseProducer<\CF\84_0_1>" = load %swift.type*, %swift.type** [[TYPARAM]]
160-
// CHECK: [[WITNESS:%.*]] = call i8** @"$s23partial_apply_forwarder12BaseProducerVyxGAA1QAAWa"(%swift.type* %"BaseProducer<\CF\84_0_1>", i8*** undef)
160+
// CHECK: [[WITNESS:%.*]] = call i8** @swift_getWitnessTable
161161
// CHECK: tail call swiftcc void @takingQ(%T23partial_apply_forwarder7WeakBoxC.1* [[CAST]], i8** [[WITNESS]])
162162
// CHECK: ret void
163163

@@ -211,7 +211,7 @@ sil hidden_external @takingQAndS : $@convention(thin) <τ_0_0 where τ_0_0 : Q>
211211
// CHECK: [[GENPARAMSADDR:%.*]] = bitcast %swift.type* [[TY]] to %swift.type**
212212
// CHECK: [[GENPARAMADDR:%.*]] = getelementptr inbounds %swift.type*, %swift.type** [[GENPARAMSADDR]], {{(i64 10|i32 13)}}
213213
// CHECK: %"BaseProducer<\CF\84_0_1>" = load %swift.type*, %swift.type** [[GENPARAMADDR]]
214-
// CHECK: [[WITNESS:%.*]] = call i8** @"$s23partial_apply_forwarder12BaseProducerVyxGAA1QAAWa"(%swift.type* %"BaseProducer<\CF\84_0_1>", i8*** undef)
214+
// CHECK: [[WITNESS:%.*]] = call i8** @swift_getWitnessTable
215215
// CHECK: tail call swiftcc void @takingQAndS(i64 [[X]], %T23partial_apply_forwarder7WeakBoxC.1* %.asUnsubstituted, i8** [[WITNESS]])
216216

217217
sil public @bind_polymorphic_param_from_context_with_layout : $@convention(thin) <τ_0_1>(@in τ_0_1, S) -> @owned @callee_owned () -> () {

test/IRGen/protocol_conformance_records.swift

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ public protocol Spoon { }
100100
// -- nominal type descriptor
101101
// CHECK-SAME: @"$s28protocol_conformance_records17NativeGenericTypeVMn"
102102
// -- witness table accessor
103-
// CHECK-SAME: @"$s28protocol_conformance_records17NativeGenericTypeVyxGAA5SpoonA2aERzlWa
103+
// CHECK-SAME: @"$s28protocol_conformance_records17NativeGenericTypeVyxGAA5Spoon
104104
// -- flags
105-
// CHECK-SAME: i32 131330
105+
// CHECK-SAME: i32 131328
106106
// -- conditional requirement #1
107107
// CHECK-SAME: i32 128,
108108
// CHECK-SAME: i32 0,
@@ -118,10 +118,10 @@ extension NativeGenericType : Spoon where T: Spoon {
118118
// CHECK-SAME: @"{{got.|__imp_}}$s18resilient_protocol22OtherResilientProtocolMp"
119119
// -- nominal type descriptor
120120
// CHECK-SAME: @"{{got.|__imp_}}$sSiMn"
121-
// -- witness table accessor
122-
// CHECK-SAME: @"$sSi18resilient_protocol22OtherResilientProtocol0B20_conformance_recordsWa"
121+
// -- witness table pattern
122+
// CHECK-SAME: @"$sSi18resilient_protocol22OtherResilientProtocol0B20_conformance_recordsWp"
123123
// -- flags
124-
// CHECK-SAME: i32 131145,
124+
// CHECK-SAME: i32 131144,
125125
// -- module context for retroactive conformance
126126
// CHECK-SAME: @"$s28protocol_conformance_recordsMXM"
127127
// CHECK-SAME: }
@@ -133,10 +133,10 @@ extension Int : OtherResilientProtocol { }
133133
// CHECK-SAME: @"$s28protocol_conformance_records9AssociateMp"
134134
// -- nominal type descriptor
135135
// CHECK-SAME: @"$s28protocol_conformance_records9DependentVMn"
136-
// -- witness table accessor
137-
// CHECK-SAME: @"$s28protocol_conformance_records9DependentVyxGAA9AssociateAAWa"
136+
// -- witness table pattern
137+
// CHECK-SAME: @"$s28protocol_conformance_records9DependentVyxGAA9AssociateAAWp"
138138
// -- flags
139-
// CHECK-SAME: i32 1
139+
// CHECK-SAME: i32 0
140140
// -- number of words in witness table
141141
// CHECK-SAME: i16 2,
142142
// -- number of private words in witness table + bit for "needs instantiation"

test/IRGen/protocol_resilience.sil

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -93,25 +93,22 @@ protocol InternalProtocol {
9393
// Witness table for conformance with resilient associated type
9494

9595
// CHECK: @"$s19protocol_resilience26ConformsWithResilientAssocVAA03HaseF0AAWP" = {{(protected )?}}hidden global [3 x i8*] [
96-
// CHECK-SAME: i8* bitcast (i8** ()* @"$s19protocol_resilience23ResilientConformingTypeV010resilient_A005OtherC8ProtocolAAWa" to i8*)
96+
// CHECK-SAME: i8* bitcast (i8** ()* @"$s19protocol_resilience23ResilientConformingTypeVAC010resilient_A005OtherC8ProtocolAAWl"
9797
// CHECK-SAME: @"symbolic 19protocol_resilience23ResilientConformingTypeV"
9898
// CHECK-SAME: ]
9999

100100
// Protocol conformance descriptor for ResilientConformingType : OtherResilientProtocol
101101

102102
// CHECK: @"$s19protocol_resilience23ResilientConformingTypeV010resilient_A005OtherC8ProtocolAAMc" =
103103

104-
// CHECK-SAME: i32 131073,
104+
// CHECK-SAME: i32 131072,
105105

106106
// -- number of witness table entries
107107
// CHECK-SAME: i16 1,
108108

109109
// -- size of private area + 'requires instantiation' bit (not set)
110110
// CHECK-SAME: i16 0,
111111

112-
// -- the template
113-
// CHECK-SAME: @"$s19protocol_resilience23ResilientConformingTypeV010resilient_A005OtherC8ProtocolAAWp"
114-
115112
// -- instantiator function
116113
// CHECK-SAME: i32 0
117114

@@ -122,7 +119,7 @@ protocol InternalProtocol {
122119
// CHECK: "$s19protocol_resilience24ConformsWithRequirementsV010resilient_A008ProtocoldE0AAMc" = hidden constant {
123120

124121
// -- flags
125-
// CHECK-SAME: i32 196609,
122+
// CHECK-SAME: i32 196608,
126123

127124
// CHECK-SAME: i32 3,
128125

@@ -142,9 +139,6 @@ protocol InternalProtocol {
142139
// -- size of private area + 'requires instantiation' bit (not set)
143140
// CHECK-SAME: i16 0,
144141

145-
// -- the template
146-
// CHECK-SAME: @"$s19protocol_resilience24ConformsWithRequirementsV010resilient_A008ProtocoldE0AAWp"
147-
148142
// -- instantiator function
149143
// CHECK-SAME: i32 0
150144

@@ -373,21 +367,14 @@ bb0(%0 : $*ResilientConformingType):
373367
// CHECK-NEXT: br i1 [[COND]], label %cacheIsNull, label %cont
374368

375369
// CHECK: cacheIsNull:
376-
// CHECK: [[WTABLE:%.*]] = call i8** @"$s19protocol_resilience23ResilientConformingTypeV010resilient_A005OtherC8ProtocolAAWa"()
370+
// CHECK: [[WTABLE:%.*]] = call i8** @swift_getWitnessTable
377371
// CHECK-NEXT: store atomic i8** [[WTABLE]], i8*** @"$s19protocol_resilience23ResilientConformingTypeVAC010resilient_A005OtherC8ProtocolAAWL" release
378372
// CHECK-NEXT: br label %cont
379373

380374
// CHECK: cont:
381375
// CHECK-NEXT: [[RESULT:%.*]] = phi i8** [ [[CCHE:%.*]], %entry ], [ [[WTABLE:%.*]], %cacheIsNull ]
382376
// CHECK-NEXT: ret i8** [[RESULT]]
383377

384-
// Resilient conformance -- must call a runtime function
385-
386-
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} i8** @"$s19protocol_resilience23ResilientConformingTypeV010resilient_A005OtherC8ProtocolAAWa"()
387-
// CHECK-NEXT: entry:
388-
// CHECK-NEXT: [[WTABLE:%.*]] = call i8** @swift_instantiateWitnessTable(%swift.protocol_conformance_descriptor* bitcast ({{[{].*[}]}}* @"$s19protocol_resilience23ResilientConformingTypeV010resilient_A005OtherC8ProtocolAAMc" to %swift.protocol_conformance_descriptor*), %swift.type* null, i8*** null)
389-
// CHECK-NEXT: ret i8** [[WTABLE]]
390-
391378

392379
//
393380
// If a protocol refines a resilient protocol, any conformances are
@@ -494,13 +481,3 @@ sil_witness_table ConformsWithRequirements : ProtocolWithRequirements module pro
494481
method #ProtocolWithRequirements.first!1: @firstWitness
495482
method #ProtocolWithRequirements.second!1: @secondWitness
496483
}
497-
498-
//
499-
// Witness table accessors for fragile conformances are emitted last
500-
//
501-
502-
// Fragile conformance -- no runtime calls needed
503-
504-
// CHECK-LABEL: define{{( dllexport)?}}{{( protected)?}} hidden i8** @"$s19protocol_resilience16ConformingStructVAA17ResilientProtocolAAWa"()
505-
// CHECK-NEXT: entry:
506-
// CHECK-NEXT: ret i8** getelementptr inbounds ([9 x i8*], [9 x i8*]* @"$s19protocol_resilience16ConformingStructVAA17ResilientProtocolAAWP", i32 0, i32 0)

test/IRGen/protocol_resilience_descriptors.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public struct ConditionallyConforms<Element> { }
5757
public struct Y { }
5858

5959
// CHECK-USAGE-LABEL: @"$s31protocol_resilience_descriptors1YV010resilient_A022OtherResilientProtocolAAMc" =
60-
// CHECK-USAGE-SAME: i32 131073,
60+
// CHECK-USAGE-SAME: i32 131072,
6161
// CHECK-USAGE-SAME: i16 1,
6262
// CHECK-USAGE-SAME: i16 0
6363
extension Y: OtherResilientProtocol { }

test/IRGen/sil_witness_tables.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct Conformer: Q, QQ {
4242
// CHECK: i8* bitcast (void (%T18sil_witness_tables9ConformerV*, %swift.type*, i8**)* @"$s18sil_witness_tables9ConformerVAA1QA2aDP7qMethod{{[_0-9a-zA-Z]*}}FTW" to i8*)
4343
// CHECK: ]
4444
// CHECK: [[CONFORMER_P_WITNESS_TABLE]] = hidden global [5 x i8*] [
45-
// CHECK: i8* bitcast (i8** ()* @"$s18sil_witness_tables14AssocConformerVAA1AAAWa" to i8*)
45+
// CHECK: i8* bitcast (i8** ()* @"$s18sil_witness_tables14AssocConformerVAcA1AAAWl" to i8*)
4646
// CHECK: "symbolic 18sil_witness_tables14AssocConformerV"
4747
// CHECK: i8* bitcast (void (%swift.type*, %swift.type*, i8**)* @"$s18sil_witness_tables9ConformerVAA1PA2aDP12staticMethod{{[_0-9a-zA-Z]*}}FZTW" to i8*),
4848
// CHECK: i8* bitcast (void (%T18sil_witness_tables9ConformerV*, %swift.type*, i8**)* @"$s18sil_witness_tables9ConformerVAA1PA2aDP14instanceMethod{{[_0-9a-zA-Z]*}}FTW" to i8*)

test/IRGen/witness_method.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct SyncUp<Deliverable> : Synergy {
6666
// CHECK: entry:
6767
// CHECK: [[TMP:%.*]] = call swiftcc %swift.metadata_response @"$s14witness_method6SyncUpVMa"([[INT]] 0, %swift.type* %T)
6868
// CHECK: [[METADATA:%.*]] = extractvalue %swift.metadata_response [[TMP]], 0
69-
// CHECK: [[WTABLE:%.*]] = call i8** @"$s14witness_method6SyncUpVyxGAA7SynergyAAWa"(%swift.type* [[METADATA]], i8*** undef)
69+
// CHECK: [[WTABLE:%.*]] = call i8** @swift_getWitnessTable(
7070
// CHECK: [[WITNESS_ADDR:%.*]] = getelementptr inbounds i8*, i8** [[WTABLE]], i32 2
7171
// CHECK: [[WITNESS_FN:%.*]] = load i8*, i8** [[WITNESS_ADDR]]
7272
// CHECK: [[WITNESS:%.*]] = bitcast i8* [[WITNESS_FN]] to void (%swift.opaque*, %swift.opaque*, %swift.type*, i8**)*

test/IRGen/witness_table_indirect_conformances.swift

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct Z: P2 {
3232

3333
// CHECK: @"$s35witness_table_indirect_conformances1WVAA2P3AAWP" = hidden global [5 x i8*] [
3434
// CHECK-SAME: @"$s35witness_table_indirect_conformances1WVAA2P3AAMc"
35-
// CHECK-SAME: i8* bitcast (i8** ()* @"$s35witness_table_indirect_conformances1YVAA1QAAWa" to i8*),
35+
// CHECK-SAME: i8* bitcast (i8** ()* @"$s35witness_table_indirect_conformances1ZVAcA2P2AAWl
3636
// CHECK-SAME: @"symbolic 35witness_table_indirect_conformances1ZV"
3737
// CHECK-SAME: i8* bitcast (void (%T35witness_table_indirect_conformances1ZV*, %T35witness_table_indirect_conformances1WV*, %swift.type*, i8**)* @"$s35witness_table_indirect_conformances1WVAA2P3A2aDP08getAssocE00gE0QzyFTW" to i8*)]
3838
struct W: P3 {
@@ -41,14 +41,6 @@ struct W: P3 {
4141
func getAssocP3() -> Z { return Z() }
4242
}
4343

44-
// CHECK-LABEL: define hidden i8** @"$s35witness_table_indirect_conformances1YVAA1QAAWa"()
45-
// CHECK-NEXT: entry:
46-
// CHECK-NEXT: ret i8** getelementptr inbounds ([1 x i8*], [1 x i8*]* @"$s35witness_table_indirect_conformances1YVAA1QAAWP", i32 0, i32 0)
47-
48-
// CHECK-LABEL: define hidden i8** @"$s35witness_table_indirect_conformances1ZVAA2P2AAWa"()
49-
// CHECK-NEXT: entry:
50-
// CHECK: ret i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @"$s35witness_table_indirect_conformances1ZVAA2P2AAWP", i32 0, i32 0)
51-
5244
// CHECK-LABEL: define hidden swiftcc %swift.metadata_response @"$s35witness_table_indirect_conformances1ZVMa"
5345
// CHECK-SAME: ([[INT]])
5446
// CHECK-NEXT: entry:

0 commit comments

Comments
 (0)