@@ -20,7 +20,7 @@ func test_returns_cgfloat(_: Double) -> CGFloat {
20
20
let d : Double = 0.0
21
21
let cgf : CGFloat = 0.0
22
22
23
- // CHECK: test_various_situations_converting_to_cgfloat()
23
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion038test_various_situations_converting_to_C0yyF : $@convention(thin) () -> () {
24
24
func test_various_situations_converting_to_cgfloat( ) {
25
25
// CHECK: function_ref @$s12CoreGraphics7CGFloatVyACSdcfC : $@convention(method) (Double, @thin CGFloat.Type) -> CGFloat
26
26
let _: CGFloat = d
@@ -58,6 +58,7 @@ func test_various_situations_converting_to_cgfloat() {
58
58
test_to_cgfloat ( test_returns_double ( d) ) // Two conversions
59
59
60
60
// Overloads with CGFloat are preferred if that allows to avoid any implicit conversions.
61
+ // CHECK-LABEL: sil private [ossa] @$s34implicit_double_cgfloat_conversion038test_various_situations_converting_to_C0yyF0E23_loading_tuple_elementsL_6valuesy12CoreGraphics7CGFloatV_AGtz_tF : $@convention(thin) (@inout (CGFloat, CGFloat)) -> () {
61
62
func test_loading_tuple_elements( values: inout ( CGFloat , CGFloat ) ) {
62
63
struct S {
63
64
init ( x: Double , y: Double ) { }
@@ -69,7 +70,7 @@ func test_various_situations_converting_to_cgfloat() {
69
70
}
70
71
}
71
72
72
- // CHECK: test_various_situations_converting_to_double()
73
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion038test_various_situations_converting_to_B0yyF : $@convention(thin) () -> () {
73
74
func test_various_situations_converting_to_double( ) {
74
75
// function_ref @$sSd12CoreGraphicsEySdAA7CGFloatVcfC : $@convention(method) (CGFloat, @thin Double.Type) -> Double
75
76
let _: Double = cgf
@@ -102,12 +103,14 @@ func test_various_situations_converting_to_double() {
102
103
test_from_cgfloat ( test_returns_cgfloat ( cgf) ) // Two conversions - argument and result.
103
104
}
104
105
106
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion31test_conversions_with_optionals1vy12CoreGraphics7CGFloatVSg_tF : $@convention(thin) (Optional<CGFloat>) -> () {
105
107
func test_conversions_with_optionals( v: CGFloat ? ) {
106
108
// CHECK: function_ref @$s34implicit_double_cgfloat_conversion31test_conversions_with_optionals1vy12CoreGraphics7CGFloatVSg_tFAFyKXEfu_
107
109
// CHECK: function_ref @$sSd12CoreGraphicsEySdAA7CGFloatVcfC : $@convention(method) (CGFloat, @thin Double.Type) -> Double
108
110
let _: Double = ( v ?? 0 )
109
111
}
110
112
113
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion48test_static_members_are_contextually_convertibleyyF : $@convention(thin) () -> () {
111
114
func test_static_members_are_contextually_convertible( ) {
112
115
struct S {
113
116
static var testProp : CGFloat { 42 }
@@ -125,6 +128,7 @@ func test_static_members_are_contextually_convertible() {
125
128
}
126
129
}
127
130
131
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion25test_narrowing_is_delayed1x1yySd_12CoreGraphics7CGFloatVtF : $@convention(thin) (Double, CGFloat) -> () {
128
132
func test_narrowing_is_delayed( x: Double , y: CGFloat ) {
129
133
func test( _: CGFloat ) { }
130
134
@@ -181,6 +185,7 @@ extension CGFloat {
181
185
}
182
186
183
187
// Make sure that solution with no Double/CGFloat conversions is preferred
188
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion38test_no_ambiguity_with_unary_operators5width6heighty12CoreGraphics7CGFloatV_AGtF : $@convention(thin) (CGFloat, CGFloat) -> () {
184
189
func test_no_ambiguity_with_unary_operators( width: CGFloat , height: CGFloat ) {
185
190
struct R {
186
191
init ( x: CGFloat , y: CGFloat , width: CGFloat , height: CGFloat ) { }
@@ -193,6 +198,7 @@ func test_no_ambiguity_with_unary_operators(width: CGFloat, height: CGFloat) {
193
198
_ = R ( x: width / 4 , y: - height / 2 , width: width, height: height)
194
199
}
195
200
201
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion40test_conversions_with_optional_promotion1d3cgfySd_12CoreGraphics7CGFloatVtF : $@convention(thin) (Double, CGFloat) -> () {
196
202
func test_conversions_with_optional_promotion( d: Double , cgf: CGFloat ) {
197
203
func test_double( _: Double ? ? , _: Double ? ? ? ) { }
198
204
func test_cgfloat( _: CGFloat ? ? , _: CGFloat ? ? ? ) { }
@@ -332,6 +338,7 @@ func test_implicit_conversion_clash_with_partial_application_check() {
332
338
}
333
339
334
340
// rdar://99352676
341
+ // CHECK-LABEL: sil hidden [ossa] @$s34implicit_double_cgfloat_conversion20test_init_validationyyF : $@convention(thin) () -> () {
335
342
func test_init_validation( ) {
336
343
class Foo {
337
344
static let bar = 100.0
0 commit comments