Skip to content

Commit ecebce8

Browse files
authored
Merge pull request #21525 from nordicio/silgen-test-enum-capitalization
2 parents c453bb9 + 430b26c commit ecebce8

File tree

3 files changed

+41
-41
lines changed

3 files changed

+41
-41
lines changed

test/SILGen/enum.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -174,33 +174,33 @@ func PolyOptionable_specialized_cases(_ t: Int) {
174174
// tuple implosion were not deallocated in enum constructors.
175175
struct String { var ptr: Builtin.NativeObject }
176176

177-
enum Foo { case A(P, String) }
177+
enum Foo { case a(P, String) }
178178

179-
// Curry Thunk for Foo.A(_:)
179+
// Curry Thunk for Foo.a(_:)
180180
//
181-
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$ss3FooO1AyABs1P_p_SStcABmF
182-
// CHECK: [[FN:%.*]] = function_ref @$ss3FooO1AyABs1P_p_SStcABmF
181+
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$ss3FooO1ayABs1P_p_SStcABmF
182+
// CHECK: [[FN:%.*]] = function_ref @$ss3FooO1ayABs1P_p_SStcABmF
183183
// CHECK-NEXT: [[METHOD:%.*]] = partial_apply [callee_guaranteed] [[FN]](%0)
184184
// CHECK-NEXT: // function_ref
185185
// CHECK-NEXT: [[CANONICAL_THUNK_FN:%.*]] = function_ref @$ss1P_pSSs3FooOIegixr_sAA_pSSACIegngr_TR : $@convention(thin) (@in_guaranteed P, @guaranteed String, @guaranteed @callee_guaranteed (@in P, @owned String) -> @out Foo) -> @out Foo
186186
// CHECK-NEXT: [[CANONICAL_THUNK:%.*]] = partial_apply [callee_guaranteed] [[CANONICAL_THUNK_FN]]([[METHOD]])
187187
// CHECK-NEXT: return [[CANONICAL_THUNK]]
188188
// CHECK-NEXT: }
189189

190-
// Foo.A(_:)
191-
// CHECK-LABEL: sil shared [transparent] [ossa] @$ss3FooO1AyABs1P_p_SStcABmF
190+
// Foo.a(_:)
191+
// CHECK-LABEL: sil shared [transparent] [ossa] @$ss3FooO1ayABs1P_p_SStcABmF
192192
// CHECK: bb0([[ARG0:%.*]] : $*Foo, [[ARG1:%.*]] : $*P, [[ARG2:%.*]] : @owned $String, [[ARG3:%.*]] : $@thin Foo.Type):
193-
// CHECK: [[PAYLOAD:%.*]] = init_enum_data_addr [[ARG0]] : $*Foo, #Foo.A!enumelt.1
193+
// CHECK: [[PAYLOAD:%.*]] = init_enum_data_addr [[ARG0]] : $*Foo, #Foo.a!enumelt.1
194194
// CHECK-NEXT: [[LEFT:%.*]] = tuple_element_addr [[PAYLOAD]] : $*(P, String), 0
195195
// CHECK-NEXT: [[RIGHT:%.*]] = tuple_element_addr [[PAYLOAD]] : $*(P, String), 1
196196
// CHECK-NEXT: copy_addr [take] [[ARG1]] to [initialization] [[LEFT]] : $*P
197197
// CHECK-NEXT: store [[ARG2]] to [init] [[RIGHT]]
198-
// CHECK-NEXT: inject_enum_addr [[ARG0]] : $*Foo, #Foo.A!enumelt.1
198+
// CHECK-NEXT: inject_enum_addr [[ARG0]] : $*Foo, #Foo.a!enumelt.1
199199
// CHECK: return
200-
// CHECK-NEXT: } // end sil function '$ss3FooO1AyABs1P_p_SStcABmF'
200+
// CHECK-NEXT: } // end sil function '$ss3FooO1ayABs1P_p_SStcABmF'
201201

202202
func Foo_cases() {
203-
_ = Foo.A
203+
_ = Foo.a
204204
}
205205

206206
enum Indirect<T> {

test/SILGen/enum_curry_thunks.swift

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
// RUN: %target-swift-emit-silgen -parse-as-library %s | %FileCheck %s
22

33
enum PartialApplyEnumPayload<T, U> {
4-
case Left(T)
5-
case Both(T, U)
4+
case left(T)
5+
case both(T, U)
66

7-
case LeftWithLabel(left: T)
8-
case BothWithLabel(left: T, right: U)
7+
case leftWithLabel(left: T)
8+
case bothWithLabel(left: T, right: U)
99

10-
case TupleWithLabel(both: (T, U))
10+
case tupleWithLabel(both: (T, U))
1111

1212
// Note: SILGen can emit these thunks correctly, but we disabled
1313
// the feature since calling the constructor directly (without a
1414
// thunk) doesn't work yet.
15-
/* case Variadic(_: Int...)
16-
case VariadicWithLabel(indices: Int...)
17-
case VariadicTuple(_: (Int, Int)...)
18-
case VariadicWithOther(String, _: Int...) */
15+
/* case variadic(_: Int...)
16+
case variadicWithLabel(indices: Int...)
17+
case variadicTuple(_: (Int, Int)...)
18+
case variadicWithOther(String, _: Int...) */
1919

20-
case Autoclosure(@autoclosure () -> ())
20+
case autoclosure(@autoclosure () -> ())
2121
}
2222

2323
struct S {}
2424
struct C {}
2525

2626
func partialApplyEnumCases(_ x: S, y: C) {
27-
_ = PartialApplyEnumPayload<S, C>.Left
28-
_ = PartialApplyEnumPayload<S, C>.Both
29-
_ = PartialApplyEnumPayload<S, C>.LeftWithLabel
30-
_ = PartialApplyEnumPayload<S, C>.TupleWithLabel
31-
/* _ = PartialApplyEnumPayload<S, C>.Variadic
32-
_ = PartialApplyEnumPayload<S, C>.VariadicWithLabel
33-
_ = PartialApplyEnumPayload<S, C>.VariadicTuple
34-
_ = PartialApplyEnumPayload<S, C>.VariadicWithOther */
35-
_ = PartialApplyEnumPayload<S, C>.Autoclosure
27+
_ = PartialApplyEnumPayload<S, C>.left
28+
_ = PartialApplyEnumPayload<S, C>.both
29+
_ = PartialApplyEnumPayload<S, C>.leftWithLabel
30+
_ = PartialApplyEnumPayload<S, C>.tupleWithLabel
31+
/* _ = PartialApplyEnumPayload<S, C>.variadic
32+
_ = PartialApplyEnumPayload<S, C>.variadicWithLabel
33+
_ = PartialApplyEnumPayload<S, C>.variadicTuple
34+
_ = PartialApplyEnumPayload<S, C>.variadicWithOther */
35+
_ = PartialApplyEnumPayload<S, C>.autoclosure
3636
}
3737

38-
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4LeftyACyxq_GxcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
39-
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4LeftyACyxq_GxcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
38+
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4leftyACyxq_GxcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
39+
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4leftyACyxq_GxcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4040

41-
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4BothyACyxq_Gx_q_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
42-
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4BothyACyxq_Gx_q_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
41+
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4bothyACyxq_Gx_q_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
42+
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO4bothyACyxq_Gx_q_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4343

44-
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13LeftWithLabelyACyxq_Gx_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
45-
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13LeftWithLabelyACyxq_Gx_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
44+
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13leftWithLabelyACyxq_Gx_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T) -> @out PartialApplyEnumPayload<T, U> {
45+
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO13leftWithLabelyACyxq_Gx_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4646

47-
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14TupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
48-
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14TupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
47+
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14tupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@in_guaranteed T, @in_guaranteed U) -> @out PartialApplyEnumPayload<T, U> {
48+
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO14tupleWithLabelyACyxq_Gx_q_t_tcAEmr0_lF : $@convention(method) <T, U> (@in T, @in U, @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
4949

50-
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11AutoclosureyACyxq_GyyXAcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@guaranteed @callee_guaranteed () -> ()) -> @out PartialApplyEnumPayload<T, U> {
51-
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11AutoclosureyACyxq_GyyXAcAEmr0_lF : $@convention(method) <T, U> (@owned @callee_guaranteed () -> (), @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {
50+
// CHECK-LABEL: sil shared [transparent] [thunk] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11autoclosureyACyxq_GyyXAcAEmr0_lFTc : $@convention(thin) <T, U> (@thin PartialApplyEnumPayload<T, U>.Type) -> @owned @callee_guaranteed (@guaranteed @callee_guaranteed () -> ()) -> @out PartialApplyEnumPayload<T, U> {
51+
// CHECK-LABEL: sil shared [transparent] [ossa] @$s17enum_curry_thunks23PartialApplyEnumPayloadO11autoclosureyACyxq_GyyXAcAEmr0_lF : $@convention(method) <T, U> (@owned @callee_guaranteed () -> (), @thin PartialApplyEnumPayload<T, U>.Type) -> @out PartialApplyEnumPayload<T, U> {

test/SILGen/enum_generic_raw_value.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
// CHECK-LABEL: sil hidden [ossa] @$s22enum_generic_raw_value1EO
44
enum E<T>: Int {
5-
case A = 1
5+
case a = 1
66
}
77

88
// CHECK-LABEL: sil hidden [ossa] @$s22enum_generic_raw_value1FO
99
enum F<T: ExpressibleByIntegerLiteral>: T where T: Equatable {
10-
case A = 1
10+
case a = 1
1111
}

0 commit comments

Comments
 (0)