forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeserialize-vtables.swift
36 lines (31 loc) · 1.29 KB
/
deserialize-vtables.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// RUN: %target-run-simple-swift(-enable-experimental-feature Extern -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s
// RUN: %target-run-simple-swift(-O -enable-experimental-feature Extern -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s
// RUN: %target-run-simple-swift(-Osize -enable-experimental-feature Extern -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: swift_feature_Embedded
// REQUIRES: swift_feature_Extern
@main
structMain{
staticfunc main(){
StaticString("Hello, World!").asUTF8Array.print()
// CHECK: Hello, World!
}
}
extensionStaticString{
varasUTF8Array:[UInt8]{
Array(UnsafeBufferPointer(start: utf8Start, count: utf8CodeUnitCount))
}
}
@_extern(c,"putchar")
@discardableResult
func putchar(_:CInt)->CInt
extension Array<UInt8>{
func print(){
forbyteinself{
putchar(CInt(byte))
}
putchar(10)
}
}