mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Also, add a third [serializable] state for functions whose bodies we *can* serialize, but only do so if they're referenced from another serialized function. This will be used for bodies synthesized for imported definitions, such as init(rawValue:), etc, and various thunks, but for now this change is NFC.
25 lines
969 B
Swift
25 lines
969 B
Swift
// RUN: rm -rf %t
|
|
// RUN: mkdir -p %t
|
|
// RUN: %target-swift-frontend -emit-module %S/Inputs/linker_pass_input.swift -o %t/Swift.swiftmodule -parse-stdlib -parse-as-library -module-name Swift -sil-serialize-all -module-link-name swiftCore
|
|
// RUN: %target-swift-frontend %s -O -I %t -sil-debug-serialization -o - -emit-sil | %FileCheck %s
|
|
|
|
// CHECK: sil public_external [serialized] @_T0s11doSomethingyyF : $@convention(thin) () -> () {
|
|
doSomething()
|
|
|
|
// Make sure we are not linking doSomething2 because it is marked with 'noimport'
|
|
|
|
// CHECK: sil [_semantics "stdlib_binary_only"] @_T0s12doSomething2yyF : $@convention(thin) () -> ()
|
|
// CHECK-NOT: return
|
|
doSomething2()
|
|
|
|
// CHECK: sil public_external [serialized] [noinline] @{{.*}}callDoSomething3{{.*}}
|
|
|
|
// CHECK: sil @unknown
|
|
|
|
// CHECK: sil [serialized] [noinline] [_semantics "stdlib_binary_only"] @{{.*}}doSomething3{{.*}}
|
|
// CHECK-NOT: return
|
|
|
|
// CHECK: sil {{.*}} @_T0s1AV{{[_0-9a-zA-Z]*}}fC
|
|
|
|
callDoSomething3()
|