@@ -245,12 +245,45 @@ bb0:
245
245
%6 = metatype $@thin String.Type
246
246
%7 = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String
247
247
%8 = apply %7(%3, %4, %5, %6) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String
248
+ %d = struct $DefaultStringInterpolation (%8 : $String)
249
+ %e = struct_extract %d : $DefaultStringInterpolation, #DefaultStringInterpolation._storage
248
250
%9 = function_ref @string_getUTF8CString : $@convention(method) (@guaranteed String) -> @owned ContiguousArray<Int8>
249
- %10 = apply %9(%8 ) : $@convention(method) (@guaranteed String) -> @owned ContiguousArray<Int8>
251
+ %10 = apply %9(%e ) : $@convention(method) (@guaranteed String) -> @owned ContiguousArray<Int8>
250
252
%11 = struct_extract %10 : $ContiguousArray<Int8>, #ContiguousArray._buffer
251
253
%12 = struct_extract %11 : $_ContiguousArrayBuffer<Int8>, #_ContiguousArrayBuffer._storage
252
254
%13 = ref_tail_addr %12 : $__ContiguousArrayStorageBase, $Int8
253
255
%14 = address_to_pointer %13 : $*Int8 to $Builtin.RawPointer
254
256
return %14 : $Builtin.RawPointer
255
257
}
256
258
259
+ // CHECK-LABEL: sil @test_interpolated_cstring
260
+ // CHECK: apply
261
+ // CHECK: [[S:%[0-9]+]] = string_literal utf8 "a"
262
+ // CHECK: return [[S]]
263
+ // CHECK: } // end sil function 'test_interpolated_cstring'
264
+ sil @test_interpolated_cstring : $@convention(thin) () -> Builtin.RawPointer {
265
+ bb0:
266
+ %3 = string_literal utf8 "a"
267
+ %4 = integer_literal $Builtin.Word, 1
268
+ %5 = integer_literal $Builtin.Int1, -1
269
+ %6 = metatype $@thin String.Type
270
+ %7 = function_ref @$sSS21_builtinStringLiteral17utf8CodeUnitCount7isASCIISSBp_BwBi1_tcfC : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String
271
+ %8 = apply %7(%3, %4, %5, %6) : $@convention(method) (Builtin.RawPointer, Builtin.Word, Builtin.Int1, @thin String.Type) -> @owned String
272
+ %d = struct $DefaultStringInterpolation (%8 : $String)
273
+ %f = function_ref @$sSS19stringInterpolationSSs013DefaultStringB0V_tcfC : $@convention(method) (@owned DefaultStringInterpolation, @thin String.Type) -> @owned String
274
+ %a = apply %f(%d, %6) : $@convention(method) (@owned DefaultStringInterpolation, @thin String.Type) -> @owned String
275
+ %9 = function_ref @string_getUTF8CString : $@convention(method) (@guaranteed String) -> @owned ContiguousArray<Int8>
276
+ %10 = apply %9(%a) : $@convention(method) (@guaranteed String) -> @owned ContiguousArray<Int8>
277
+ %11 = struct_extract %10 : $ContiguousArray<Int8>, #ContiguousArray._buffer
278
+ %12 = struct_extract %11 : $_ContiguousArrayBuffer<Int8>, #_ContiguousArrayBuffer._storage
279
+ %13 = ref_tail_addr %12 : $__ContiguousArrayStorageBase, $Int8
280
+ %14 = address_to_pointer %13 : $*Int8 to $Builtin.RawPointer
281
+ return %14 : $Builtin.RawPointer
282
+ }
283
+
284
+ sil public_external [readonly] @$sSS19stringInterpolationSSs013DefaultStringB0V_tcfC : $@convention(method) (@owned DefaultStringInterpolation, @thin String.Type) -> @owned String {
285
+ bb0(%0 : $DefaultStringInterpolation, %1 : $@thin String.Type):
286
+ %2 = struct_extract %0 : $DefaultStringInterpolation, #DefaultStringInterpolation._storage
287
+ return %2 : $String
288
+ }
289
+
0 commit comments