Skip to content

Commit d3c6d1f

Browse files
committed
Revert "Address @gribozavr comments to 273b149"
This reverts commit 062d14b. Revert "Fix a swift argument initialization bug - swift argument should be initialized" This reverts commit 273b149. This breaks DebugAssert as well as REPL builds. Revert to appease the bots while i look further.
1 parent d887d82 commit d3c6d1f

19 files changed

+142
-165
lines changed

stdlib/public/core/Process.swift

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,21 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
public enum Process {
14-
/// Initialize the swift argument with the list of command-line arguments
15-
/// with which the current process was invoked.
16-
internal static func _initArguments() {
17-
for i in 0..<Int(argc) {
18-
_arguments.append(
19-
String.fromCStringRepairingIllFormedUTF8(unsafeArgv[i]).0 ?? "")
14+
/// The list of command-line arguments with which the current
15+
/// process was invoked.
16+
public static let arguments: [String] = {
17+
// Use lazy initialization of static properties to safely initialize the
18+
// public 'arguments' property on first use.
19+
(0..<Int(argc)).map { i in
20+
String.fromCStringRepairingIllFormedUTF8(unsafeArgv[i]).0 ?? ""
2021
}
21-
}
22+
}()
2223

2324
internal static var _argc: CInt = CInt()
2425
internal static var _unsafeArgv:
2526
UnsafeMutablePointer<UnsafeMutablePointer<Int8>>
2627
= nil
2728

28-
internal static var _arguments: [String] = []
29-
30-
/// The list of command-line arguments with which the current
31-
/// process was invoked.
32-
public static var arguments: [String] {
33-
return _arguments
34-
}
35-
3629
/// Access to the raw argc value from C.
3730
public static var argc: CInt {
3831
return _argc
@@ -56,8 +49,5 @@ func _didEnterMain(
5649
// values that were passed in to main.
5750
Process._argc = CInt(argc)
5851
Process._unsafeArgv = UnsafeMutablePointer(argv)
59-
// Arguments can only be initialized after _argc and _unsafeArgv are
60-
// initialized.
61-
Process._initArguments();
6252
}
6353

test/ClangModules/attr-swift_private.swift

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ public func testTopLevel() {
8484
#endif
8585
}
8686

87+
// CHECK-LABEL: define linkonce_odr hidden %swift.type* @_TMaCSo12__PrivFooSub{{.*}} {
88+
// CHECK: %objc_class* @"OBJC_CLASS_$_PrivFooSub"
89+
// CHECK: }
90+
8791
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @_TTOFCSo3BarcfT2__Vs5Int32_GSQS__
8892
// CHECK: @"\01L_selector(init:)"
8993
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @_TTOFCSo3BarcfT9__twoArgsVs5Int325otherS0__GSQS__
@@ -93,13 +97,6 @@ public func testTopLevel() {
9397
// CHECK-LABEL: define linkonce_odr hidden {{.+}} @_TTOFCSo3BarcfT8__noArgsT__GSQS__
9498
// CHECK: @"\01L_selector(initWithNoArgs)"
9599

96-
97-
98-
// CHECK-LABEL: define linkonce_odr hidden %swift.type* @_TMaCSo12__PrivFooSub{{.*}} {
99-
// CHECK: %objc_class* @"OBJC_CLASS_$_PrivFooSub"
100-
// CHECK: }
101-
102-
103100
_ = __PrivAnonymousA
104101
_ = __E0PrivA
105102
_ = __PrivE1A as __PrivE1

test/IRGen/c_globals.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import c_layout
66
func blackHole<T>(t: T) { }
77

88
// CHECK: @staticFloat = internal global float 1.700000e+01, align 4
9+
// CHECK: define internal void @doubleTrouble() [[CLANG_FUNC_ATTR:#[0-9]+]] {
910

1011
public func testStaticGlobal() {
1112
blackHole(c_layout.staticFloat)
@@ -30,7 +31,5 @@ public func testCaptureGlobal() {
3031
}) // CHECK: {{^}$}}
3132
}
3233

33-
// CHECK: define internal void @doubleTrouble() [[CLANG_FUNC_ATTR:#[0-9]+]] {
34-
3534
// CHECK: attributes [[SWIFT_FUNC_ATTR]] = { "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"
3635
// CHECK: attributes [[CLANG_FUNC_ATTR]] = { inlinehint nounwind {{(ssp )?}}{{(uwtable )?}}"no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "target-cpu"

test/IRGen/clang_inline.swift

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,25 @@ class CallStaticInline {
2121
func ReturnZero() -> Int64 { return Int64(zero()) }
2222
}
2323

24+
// CHECK-LABEL: define internal i32 @zero()
25+
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
26+
2427
// CHECK-LABEL: define hidden i64 @_TFC12clang_inline17CallStaticInline210ReturnZerofT_Vs5Int64(%C12clang_inline17CallStaticInline2*) {{.*}} {
2528
class CallStaticInline2 {
2629
func ReturnZero() -> Int64 { return Int64(wrappedZero()) }
2730
}
2831

32+
// CHECK-LABEL: define internal i32 @wrappedZero()
33+
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
2934

3035
// CHECK-LABEL: define hidden i32 @_TF12clang_inline10testExternFT_Vs5Int32() {{.*}} {
3136
func testExtern() -> CInt {
3237
return wrappedGetInt()
3338
}
3439

40+
// CHECK-LABEL: define internal i32 @wrappedGetInt()
41+
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
42+
3543
// CHECK-LABEL: define hidden i32 @_TF12clang_inline16testAlwaysInlineFT_Vs5Int32()
3644
// CHECK: [[SSP:#[0-9]+]] {
3745
// NEGATIVE-NOT: @alwaysInlineNumber
@@ -45,37 +53,28 @@ func testInlineRedeclared() -> CInt {
4553
return zeroRedeclared()
4654
}
4755

56+
// CHECK-LABEL: define internal i32 @zeroRedeclared() #{{[0-9]+}} {
57+
4858
// CHECK-LABEL: define hidden i32 @_TF12clang_inline27testInlineRedeclaredWrappedFT_Vs5Int32() {{.*}} {
4959
func testInlineRedeclaredWrapped() -> CInt {
5060
return wrappedZeroRedeclared()
5161
}
5262

63+
// CHECK-LABEL: define internal i32 @wrappedZeroRedeclared() #{{[0-9]+}} {
64+
5365
// CHECK-LABEL: define hidden i32 @_TF12clang_inline22testStaticButNotInlineFT_Vs5Int32() {{.*}} {
5466
func testStaticButNotInline() -> CInt {
5567
return staticButNotInline()
5668
}
5769

58-
// CHECK-LABEL: define internal i32 @zero()
59-
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
60-
61-
// CHECK-LABEL: define internal i32 @wrappedZero()
62-
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
63-
64-
// CHECK-LABEL: define internal i32 @wrappedGetInt()
65-
// CHECK: [[INLINEHINT_SSP_UWTABLE:#[0-9]+]] {
66-
67-
// CHECK-LABEL: define internal i32 @zeroRedeclared() #{{[0-9]+}} {
68-
69-
// CHECK-LABEL: define internal i32 @wrappedZeroRedeclared() #{{[0-9]+}} {
70-
7170
// CHECK-LABEL: define internal i32 @staticButNotInline() #{{[0-9]+}} {
7271

7372
// CHECK-LABEL: define internal i32 @innerZero()
7473
// CHECK: [[INNER_ZERO_ATTR:#[0-9]+]] {
7574
// CHECK-LABEL: declare i32 @getInt()
7675
// CHECK: [[GET_INT_ATTR:#[0-9]+]]
7776

78-
// CHECK: attributes [[SSP]] = { ssp {{.*}} }
7977
// CHECK: attributes [[INLINEHINT_SSP_UWTABLE]] = { inlinehint ssp {{.*}}}
78+
// CHECK: attributes [[SSP]] = { ssp {{.*}} }
8079
// CHECK: attributes [[INNER_ZERO_ATTR]] = { inlinehint nounwind ssp
8180
// CHECK: attributes [[GET_INT_ATTR]] = {

test/IRGen/clang_inline_reverse.swift

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,18 @@
77

88
import gizmo
99

10-
11-
// CHECK-LABEL: define hidden i64 @_TFC12clang_inline17CallStaticInline210ReturnZerofT_Vs5Int64(%C12clang_inline17CallStaticInline2*) {{.*}} {
12-
class CallStaticInline2 {
13-
func ReturnZero() -> Int64 { return Int64(zero()) }
14-
}
15-
1610
// CHECK-LABEL: define hidden i64 @_TFC12clang_inline16CallStaticInline10ReturnZerofT_Vs5Int64(%C12clang_inline16CallStaticInline*) {{.*}} {
1711
class CallStaticInline {
1812
func ReturnZero() -> Int64 { return Int64(wrappedZero()) }
1913
}
2014

21-
22-
// CHECK-LABEL: define internal i32 @zero() {{#[0-9]+}} {
23-
2415
// CHECK-LABEL: define internal i32 @wrappedZero() {{#[0-9]+}} {
2516

26-
// CHECK-LABEL: define internal i32 @innerZero() {{#[0-9]+}} {
17+
// CHECK-LABEL: define hidden i64 @_TFC12clang_inline17CallStaticInline210ReturnZerofT_Vs5Int64(%C12clang_inline17CallStaticInline2*) {{.*}} {
18+
class CallStaticInline2 {
19+
func ReturnZero() -> Int64 { return Int64(zero()) }
20+
}
2721

22+
// CHECK-LABEL: define internal i32 @zero() {{#[0-9]+}} {
2823

24+
// CHECK-LABEL: define internal i32 @innerZero() {{#[0-9]+}} {

test/IRGen/class_resilience.swift

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,24 @@ public class MyResilientChild : MyResilientParent {
110110
public let field: Int32 = 0
111111
}
112112

113+
114+
// ClassWithResilientProperty metadata accessor
115+
116+
// CHECK-LABEL: define %swift.type* @_TMaC16class_resilience26ClassWithResilientProperty()
117+
// CHECK: [[CACHE:%.*]] = load %swift.type*, %swift.type** @_TMLC16class_resilience26ClassWithResilientProperty
118+
// CHECK-NEXT: [[COND:%.*]] = icmp eq %swift.type* [[CACHE]], null
119+
// CHECK-NEXT: br i1 [[COND]], label %cacheIsNull, label %cont
120+
121+
// CHECK: cacheIsNull:
122+
// CHECK-NEXT: [[METADATA:%.*]] = call %swift.type* @swift_getResilientMetadata(
123+
// CHECK-NEXT: store %swift.type* [[METADATA]], %swift.type** @_TMLC16class_resilience26ClassWithResilientProperty
124+
// CHECK-NEXT: br label %cont
125+
126+
// CHECK: cont:
127+
// CHECK-NEXT: [[RESULT:%.*]] = phi %swift.type* [ [[CACHE]], %entry ], [ [[METADATA]], %cacheIsNull ]
128+
// CHECK-NEXT: ret %swift.type* [[RESULT]]
129+
130+
113131
// ClassWithResilientProperty.color getter
114132

115133
// CHECK-LABEL: define i32 @_TFC16class_resilience26ClassWithResilientPropertyg5colorVs5Int32(%C16class_resilience26ClassWithResilientProperty*)
@@ -121,6 +139,24 @@ public class MyResilientChild : MyResilientParent {
121139
// CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, i32* [[FIELD_PAYLOAD]]
122140
// CHECK-NEXT: ret i32 [[FIELD_VALUE]]
123141

142+
143+
// ClassWithResilientlySizedProperty metadata accessor
144+
145+
// CHECK-LABEL: define %swift.type* @_TMaC16class_resilience33ClassWithResilientlySizedProperty()
146+
// CHECK: [[CACHE:%.*]] = load %swift.type*, %swift.type** @_TMLC16class_resilience33ClassWithResilientlySizedProperty
147+
// CHECK-NEXT: [[COND:%.*]] = icmp eq %swift.type* [[CACHE]], null
148+
// CHECK-NEXT: br i1 [[COND]], label %cacheIsNull, label %cont
149+
150+
// CHECK: cacheIsNull:
151+
// CHECK-NEXT: [[METADATA:%.*]] = call %swift.type* @swift_getResilientMetadata(
152+
// CHECK-NEXT: store %swift.type* [[METADATA]], %swift.type** @_TMLC16class_resilience33ClassWithResilientlySizedProperty
153+
// CHECK-NEXT: br label %cont
154+
155+
// CHECK: cont:
156+
// CHECK-NEXT: [[RESULT:%.*]] = phi %swift.type* [ [[CACHE]], %entry ], [ [[METADATA]], %cacheIsNull ]
157+
// CHECK-NEXT: ret %swift.type* [[RESULT]]
158+
159+
124160
// ClassWithResilientlySizedProperty.color getter
125161

126162
// CHECK-LABEL: define i32 @_TFC16class_resilience33ClassWithResilientlySizedPropertyg5colorVs5Int32(%C16class_resilience33ClassWithResilientlySizedProperty*)
@@ -132,6 +168,7 @@ public class MyResilientChild : MyResilientParent {
132168
// CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, i32* [[FIELD_PAYLOAD]]
133169
// CHECK-NEXT: ret i32 [[FIELD_VALUE]]
134170

171+
135172
// ClassWithIndirectResilientEnum.color getter
136173

137174
// CHECK-LABEL: define i32 @_TFC16class_resilience30ClassWithIndirectResilientEnumg5colorVs5Int32(%C16class_resilience30ClassWithIndirectResilientEnum*)
@@ -140,6 +177,7 @@ public class MyResilientChild : MyResilientParent {
140177
// CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, i32* [[FIELD_PAYLOAD]]
141178
// CHECK-NEXT: ret i32 [[FIELD_VALUE]]
142179

180+
143181
// ResilientChild.field getter
144182

145183
// CHECK-LABEL: define i32 @_TFC16class_resilience14ResilientChildg5fieldVs5Int32(%C16class_resilience14ResilientChild*)
@@ -151,6 +189,7 @@ public class MyResilientChild : MyResilientParent {
151189
// CHECK-NEXT: [[FIELD_VALUE:%.*]] = load i32, i32* [[FIELD_PAYLOAD]]
152190
// CHECK-NEXT: ret i32 [[FIELD_VALUE]]
153191

192+
154193
// ResilientGenericChild.field getter
155194

156195

@@ -175,6 +214,7 @@ public class MyResilientChild : MyResilientParent {
175214
// CHECK-NEXT: [[RESULT:%.*]] = load i32, i32* [[PAYLOAD_ADDR]]
176215
// CHECK-NEXT: ret i32 [[RESULT]]
177216

217+
178218
// MyResilientChild.field getter
179219

180220
// CHECK-LABEL: define i32 @_TFC16class_resilience16MyResilientChildg5fieldVs5Int32(%C16class_resilience16MyResilientChild*)
@@ -183,37 +223,6 @@ public class MyResilientChild : MyResilientParent {
183223
// CHECK-NEXT: [[RESULT:%.*]] = load i32, i32* [[PAYLOAD_ADDR]]
184224
// CHECK-NEXT: ret i32 [[RESULT]]
185225

186-
// ClassWithResilientProperty metadata accessor
187-
188-
// CHECK-LABEL: define %swift.type* @_TMaC16class_resilience26ClassWithResilientProperty()
189-
// CHECK: [[CACHE:%.*]] = load %swift.type*, %swift.type** @_TMLC16class_resilience26ClassWithResilientProperty
190-
// CHECK-NEXT: [[COND:%.*]] = icmp eq %swift.type* [[CACHE]], null
191-
// CHECK-NEXT: br i1 [[COND]], label %cacheIsNull, label %cont
192-
193-
// CHECK: cacheIsNull:
194-
// CHECK-NEXT: [[METADATA:%.*]] = call %swift.type* @swift_getResilientMetadata(
195-
// CHECK-NEXT: store %swift.type* [[METADATA]], %swift.type** @_TMLC16class_resilience26ClassWithResilientProperty
196-
// CHECK-NEXT: br label %cont
197-
198-
// CHECK: cont:
199-
// CHECK-NEXT: [[RESULT:%.*]] = phi %swift.type* [ [[CACHE]], %entry ], [ [[METADATA]], %cacheIsNull ]
200-
// CHECK-NEXT: ret %swift.type* [[RESULT]]
201-
202-
// ClassWithResilientlySizedProperty metadata accessor
203-
204-
// CHECK-LABEL: define %swift.type* @_TMaC16class_resilience33ClassWithResilientlySizedProperty()
205-
// CHECK: [[CACHE:%.*]] = load %swift.type*, %swift.type** @_TMLC16class_resilience33ClassWithResilientlySizedProperty
206-
// CHECK-NEXT: [[COND:%.*]] = icmp eq %swift.type* [[CACHE]], null
207-
// CHECK-NEXT: br i1 [[COND]], label %cacheIsNull, label %cont
208-
209-
// CHECK: cacheIsNull:
210-
// CHECK-NEXT: [[METADATA:%.*]] = call %swift.type* @swift_getResilientMetadata(
211-
// CHECK-NEXT: store %swift.type* [[METADATA]], %swift.type** @_TMLC16class_resilience33ClassWithResilientlySizedProperty
212-
// CHECK-NEXT: br label %cont
213-
214-
// CHECK: cont:
215-
// CHECK-NEXT: [[RESULT:%.*]] = phi %swift.type* [ [[CACHE]], %entry ], [ [[METADATA]], %cacheIsNull ]
216-
// CHECK-NEXT: ret %swift.type* [[RESULT]]
217226

218227
// ClassWithResilientProperty metadata instantiation function
219228

@@ -232,6 +241,7 @@ public class MyResilientChild : MyResilientParent {
232241
// CHECK-native-NEXT: store [[INT]] [[FIELD_OFFSET]], [[INT]]* @_TWvdvC16class_resilience26ClassWithResilientProperty5colorVs5Int32
233242
// CHECK: ret %swift.type* [[METADATA]]
234243

244+
235245
// ClassWithResilientlySizedProperty metadata instantiation function
236246

237247
// CHECK-LABEL: define private %swift.type* @create_generic_metadata_ClassWithResilientlySizedProperty(%swift.type_pattern*, i8**)

test/IRGen/closure.swift

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,13 @@ func b<T : Ordinable>(seq seq: T) -> (Int) -> Int {
2121
return { i in i + seq.ord() }
2222
}
2323

24-
// -- Closure entry point
25-
// CHECK: define linkonce_odr hidden i64 @[[CLOSURE2:_TFF7closure1buRxS_9OrdinablerFT3seqx_FSiSiU_FSiSi]](i64, %swift.refcounted*, %swift.type* %T, i8** %T.Ordinable) {{.*}} {
26-
27-
// -- <rdar://problem/14443343> Boxing of tuples with generic elements
28-
// CHECK: define hidden { i8*, %swift.refcounted* } @_TF7closure14captures_tupleu0_rFT1xTxq___FT_Txq__(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type* %T, %swift.type* %U)
29-
func captures_tuple<T, U>(x x: (T, U)) -> () -> (T, U) {
30-
// CHECK: [[METADATA:%.*]] = call %swift.type* @swift_getTupleTypeMetadata2(%swift.type* %T, %swift.type* %U, i8* null, i8** null)
31-
// CHECK-NOT: @swift_getTupleTypeMetadata2
32-
// CHECK: [[BOX:%.*]] = call { %swift.refcounted*, %swift.opaque* } @swift_allocBox(%swift.type* [[METADATA]])
33-
// CHECK: [[ADDR:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[BOX]], 1
34-
// CHECK: bitcast %swift.opaque* [[ADDR]] to <{}>*
35-
return {x}
36-
}
37-
3824
// -- partial_apply stub
3925
// CHECK: define internal i64 @_TPA_[[CLOSURE1]](i64, %swift.refcounted*) {{.*}} {
4026
// CHECK: }
4127

28+
// -- Closure entry point
29+
// CHECK: define linkonce_odr hidden i64 @[[CLOSURE2:_TFF7closure1buRxS_9OrdinablerFT3seqx_FSiSiU_FSiSi]](i64, %swift.refcounted*, %swift.type* %T, i8** %T.Ordinable) {{.*}} {
30+
4231
// -- partial_apply stub
4332
// CHECK: define internal i64 @_TPA_[[CLOSURE2]](i64, %swift.refcounted*) {{.*}} {
4433
// CHECK: entry:
@@ -57,4 +46,13 @@ func captures_tuple<T, U>(x x: (T, U)) -> () -> (T, U) {
5746
// CHECK: ret i64 [[RES]]
5847
// CHECK: }
5948

60-
49+
// -- <rdar://problem/14443343> Boxing of tuples with generic elements
50+
// CHECK: define hidden { i8*, %swift.refcounted* } @_TF7closure14captures_tupleu0_rFT1xTxq___FT_Txq__(%swift.opaque* noalias nocapture, %swift.opaque* noalias nocapture, %swift.type* %T, %swift.type* %U)
51+
func captures_tuple<T, U>(x x: (T, U)) -> () -> (T, U) {
52+
// CHECK: [[METADATA:%.*]] = call %swift.type* @swift_getTupleTypeMetadata2(%swift.type* %T, %swift.type* %U, i8* null, i8** null)
53+
// CHECK-NOT: @swift_getTupleTypeMetadata2
54+
// CHECK: [[BOX:%.*]] = call { %swift.refcounted*, %swift.opaque* } @swift_allocBox(%swift.type* [[METADATA]])
55+
// CHECK: [[ADDR:%.*]] = extractvalue { %swift.refcounted*, %swift.opaque* } [[BOX]], 1
56+
// CHECK: bitcast %swift.opaque* [[ADDR]] to <{}>*
57+
return {x}
58+
}

test/IRGen/dynamic_self_metadata.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
// FIXME: Not a SIL test because we can't parse dynamic Self in SIL.
66
// <rdar://problem/16931299>
77

8-
// CHECK: [[TYPE:%.+]] = type <{ [8 x i8] }>
98
// CHECK: [[TYPE:%.+]] = type <{ [8 x i8] }>
109

1110
@inline(never) func id<T>(t: T) -> T {

test/IRGen/enum_resilience.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,6 @@ public func resilientEnumPartialApply(f: Medium -> Int) {
200200
// CHECK: ret void
201201
}
202202

203-
// Make sure we call a function to access metadata of enums with
204-
// resilient layout.
205-
206-
// CHECK-LABEL: define %swift.type* @_TF15enum_resilience20getResilientEnumTypeFT_PMP_()
207-
// CHECK: [[METADATA:%.*]] = call %swift.type* @_TMaO15enum_resilience24EnumWithResilientPayload()
208-
// CHECK-NEXT: ret %swift.type* [[METADATA]]
209-
210203
// CHECK-LABEL: define internal void @_TPA__TTRXFo_iO14resilient_enum6Medium_dSi_XFo_iS0__iSi_(%Si* noalias nocapture sret, %swift.opaque* noalias nocapture, %swift.refcounted*)
211204

212205

@@ -218,6 +211,13 @@ public enum EnumWithResilientPayload {
218211
case TwoSizes(Size, Size)
219212
}
220213

214+
// Make sure we call a function to access metadata of enums with
215+
// resilient layout.
216+
217+
// CHECK-LABEL: define %swift.type* @_TF15enum_resilience20getResilientEnumTypeFT_PMP_()
218+
// CHECK: [[METADATA:%.*]] = call %swift.type* @_TMaO15enum_resilience24EnumWithResilientPayload()
219+
// CHECK-NEXT: ret %swift.type* [[METADATA]]
220+
221221
public func getResilientEnumType() -> Any.Type {
222222
return EnumWithResilientPayload.self
223223
}

0 commit comments

Comments
 (0)