mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
LinkNormal mode is used by the mandatory pipeline. It only needs to deserialize what is necessary for code generation, that is functions with shared linkage that must be emitted into the client.
26 lines
1.4 KiB
Swift
26 lines
1.4 KiB
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -emit-module -o %t %S/Inputs/def_noinline.swift
|
|
// RUN: llvm-bcanalyzer %t/def_noinline.swiftmodule | %FileCheck %s
|
|
// RUN: %target-swift-frontend -emit-sib -I %t %s -o %t/noinline.sib
|
|
// RUN: %target-sil-opt -performance-linker %t/noinline.sib -I %t | %FileCheck %s -check-prefix=SIL
|
|
|
|
// CHECK-NOT: UnknownCode
|
|
|
|
import def_noinline
|
|
|
|
// SIL-LABEL: sil public_external [serialized] [noinline] [canonical] @$S12def_noinline18NoInlineInitStructV1xACSb_tcfC : $@convention(method) (Bool, @thin NoInlineInitStruct.Type) -> NoInlineInitStruct {
|
|
|
|
// SIL-LABEL: sil public_external [serialized] [noinline] [canonical] @$S12def_noinline12testNoinline1xS2b_tF : $@convention(thin) (Bool) -> Bool {
|
|
|
|
// SIL-LABEL: sil @main
|
|
// SIL: [[RAW:%.+]] = global_addr @$S8noinline3rawSbvp : $*Bool
|
|
// SIL: [[FUNC:%.+]] = function_ref @$S12def_noinline12testNoinline1xS2b_tF : $@convention(thin) (Bool) -> Bool
|
|
// SIL: [[RESULT:%.+]] = apply [[FUNC]]({{%.+}}) : $@convention(thin) (Bool) -> Bool
|
|
// SIL: store [[RESULT]] to [[RAW]] : $*Bool
|
|
var raw = testNoinline(x: false)
|
|
|
|
// SIL: [[FUNC2:%.+]] = function_ref @$S12def_noinline18NoInlineInitStructV1xACSb_tcfC : $@convention(method) (Bool, @thin NoInlineInitStruct.Type) -> NoInlineInitStruct
|
|
// SIL: apply [[FUNC2]]({{%.+}}, {{%.+}}) : $@convention(method) (Bool, @thin NoInlineInitStruct.Type) -> NoInlineInitStruct
|
|
|
|
var a = NoInlineInitStruct(x: false)
|