mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[embedded] Implement missing _convertConstStringToUTF8PointerArgument to support string to pointer conversion
This commit is contained in:
16
test/embedded/string-to-pointer.swift
Normal file
16
test/embedded/string-to-pointer.swift
Normal file
@@ -0,0 +1,16 @@
|
||||
// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -wmo) | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_in_compiler
|
||||
// REQUIRES: executable_test
|
||||
// REQUIRES: optimized_stdlib
|
||||
// REQUIRES: OS=macosx || OS=linux-gnu
|
||||
|
||||
@_extern(c)
|
||||
func puts(_ string: UnsafePointer<CChar>?) -> CInt
|
||||
|
||||
func foo(_ string: UnsafePointer<CChar>?) {
|
||||
puts(string)
|
||||
}
|
||||
|
||||
foo("hello")
|
||||
// CHECK: hello
|
||||
Reference in New Issue
Block a user