mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
- test changes
This commit is contained in:
committed by
Meghana Gupta
parent
008e10c2ec
commit
830565b0f0
@@ -31,7 +31,7 @@ func caller_of_with_control_flow(x: Float) -> Float {
|
||||
gradient(at: x, of: with_control_flow)
|
||||
}
|
||||
// CHECK-LABEL: decision {{.*}} $s12vjp_inlining17with_control_flowyS2fFTJrSpSr
|
||||
// CHECK-NEXT: "reverse-mode derivative of vjp_inlining.with_control_flow(_:)" inlined into "caller_of_with_control_flow"
|
||||
// CHECK-NEXT: "reverse-mode derivative of vjp_inlining.with_control_flow(_:)" inlined into "reverse-mode derivative of vjp_inlining.wrapperOnWithControlFlow(x:)"
|
||||
|
||||
// =============================================================== //
|
||||
// VJPs with control-flow are inlined into VJP callers
|
||||
@@ -42,7 +42,7 @@ func wrapperOnWithControlFlow(x: Float) -> Float {
|
||||
return with_control_flow(x)
|
||||
}
|
||||
// CHECK-LABEL: decision {{.*}} $s12vjp_inlining17with_control_flowyS2fFTJrSpSr
|
||||
// CHECK-NEXT: "reverse-mode derivative of vjp_inlining.with_control_flow(_:)" inlined into "reverse-mode derivative of vjp_inlining.wrapperOnWithControlFlow(x:)"
|
||||
// CHECK-NEXT: "reverse-mode derivative of vjp_inlining.with_control_flow(_:)" inlined into "caller_of_with_control_flow"
|
||||
|
||||
// =============================================================== //
|
||||
// VJPs without control-flow are not inlined into non-VJP callers
|
||||
|
||||
@@ -121,8 +121,6 @@
|
||||
// RUN: %target-swift-frontend -typecheck -sdk '' -module-cache-path %t/MCP.Osize -parse-stdlib -I %t %t/test.Osize.remark.swift -Rmodule-interface-rebuild -verify
|
||||
// RUN: ls %t/MCP.Osize | count 3
|
||||
// RUN: %target-swift-frontend -typecheck -sdk '' -module-cache-path %t/MCP.Osize -parse-stdlib -I %t %t/test.Osize.swift -Rmodule-interface-rebuild -verify
|
||||
// The grep at the end is an inverse so we are validating that the line doesn't have ossa.
|
||||
// RUN: %target-sil-opt -module-name SwiftModuleOsize %t/MCP.Osize/*.swiftmodule | grep '@$s16SwiftModuleOsize3fooAA5KlassCyF' | grep -v '[[]ossa[]]'
|
||||
// RUN: mv %t/MCP.Osize/*.swiftmodule %t/MCP.Osize/old
|
||||
// RUN: ls %t/MCP.Osize | count 2
|
||||
// RUN: %target-swift-frontend -typecheck -sdk '' -enable-ossa-modules -module-cache-path %t/MCP.Osize -parse-stdlib -I %t %t/test.Osize.remark.swift -Rmodule-interface-rebuild -verify
|
||||
@@ -149,8 +147,6 @@
|
||||
// RUN: %target-swift-frontend -typecheck -sdk '' -module-cache-path %t/MCP.O -parse-stdlib -I %t %t/test.O.remark.swift -Rmodule-interface-rebuild -verify
|
||||
// RUN: ls %t/MCP.O | count 3
|
||||
// RUN: %target-swift-frontend -typecheck -sdk '' -module-cache-path %t/MCP.O -parse-stdlib -I %t %t/test.O.swift -Rmodule-interface-rebuild -verify
|
||||
// The grep at the end is an inverse so we are validating that the line doesn't have ossa.
|
||||
// RUN: %target-sil-opt -module-name SwiftModuleO %t/MCP.O/*.swiftmodule | grep '@$s12SwiftModuleO3fooAA5KlassCyF' | grep -v '[[]ossa[]]'
|
||||
// RUN: mv %t/MCP.O/*.swiftmodule %t/MCP.O/old
|
||||
// RUN: ls %t/MCP.O | count 2
|
||||
// RUN: %target-swift-frontend -typecheck -sdk '' -enable-ossa-modules -module-cache-path %t/MCP.O -parse-stdlib -I %t %t/test.O.remark.swift -Rmodule-interface-rebuild -verify
|
||||
|
||||
@@ -11,6 +11,6 @@
|
||||
// CHECK: sil_stage raw
|
||||
//
|
||||
// Verify that the '[canonical]' attribute was set.
|
||||
// CHECK: sil [serialized] [canonical] @$s5stage21functionToReserializeyyF : $@convention(thin) () -> () {
|
||||
// CHECK: sil [serialized] [canonical] [ossa] @$s5stage21functionToReserializeyyF : $@convention(thin) () -> () {
|
||||
@inlinable
|
||||
public func functionToReserialize() {}
|
||||
|
||||
@@ -6,7 +6,7 @@ import Swift
|
||||
import FunctionInput
|
||||
|
||||
// Make sure we can deserialize a SIL function with these various attributes.
|
||||
// CHECK: sil public_external [serialized] {{.*}}[canonical] @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X {
|
||||
// CHECK: sil public_external [serialized] {{.*}}[canonical] [ossa] @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X {
|
||||
|
||||
sil @foo : $@convention(thin) (@in X, @inout X, @in_guaranteed X, @owned X, X, @guaranteed X) -> @out X
|
||||
|
||||
|
||||
@@ -28,25 +28,19 @@ func checkResult(_ plaintext: [UInt8]) {
|
||||
|
||||
@_semantics("optremark.sil-assembly-vision-remark-gen")
|
||||
public func run_ChaCha(_ N: Int) {
|
||||
let key = Array(repeating: UInt8(1), count: 32)
|
||||
let nonce = Array(repeating: UInt8(2), count: 12)
|
||||
let key = Array(repeating: UInt8(1), count: 32) // expected-remark {{release of type '}}
|
||||
let nonce = Array(repeating: UInt8(2), count: 12) // expected-remark {{release of type '}}
|
||||
|
||||
var checkedtext = Array(repeating: UInt8(0), count: 1024)
|
||||
var checkedtext = Array(repeating: UInt8(0), count: 1024) // expected-note {{of 'checkedtext}}
|
||||
ChaCha20.encrypt(bytes: &checkedtext, key: key, nonce: nonce)
|
||||
checkResult(checkedtext)
|
||||
|
||||
|
||||
var plaintext = Array(repeating: UInt8(0), count: 30720)
|
||||
var plaintext = Array(repeating: UInt8(0), count: 30720) // expected-note {{of 'plaintext}}
|
||||
for _ in 1...N {
|
||||
ChaCha20.encrypt(bytes: &plaintext, key: key, nonce: nonce)
|
||||
print(plaintext.first!) // expected-remark @:11 {{heap allocated ref of type '}}
|
||||
// expected-remark @-1:27 {{release of type '}}
|
||||
}
|
||||
} // expected-remark {{release of type '}}
|
||||
// expected-note @-7 {{of 'plaintext}}
|
||||
// expected-remark @-2 {{release of type '}}
|
||||
// expected-note @-16 {{of 'nonce}}
|
||||
// expected-remark @-4 {{release of type '}}
|
||||
// expected-note @-19 {{of 'key}}
|
||||
// expected-remark @-6 {{release of type '}}
|
||||
// expected-note @-18 {{of 'checkedtext}}
|
||||
// expected-remark @-1 {{release of type '}}
|
||||
|
||||
@@ -69,16 +69,11 @@ func bar() async {}
|
||||
// CHECK: [[PTR:%[^,]+]] = struct_extract [[UMP]]
|
||||
// CHECK: [[ADDR:%[^,]+]] = pointer_to_address [[PTR]]
|
||||
// CHECK: store [[CONSUMED_INSTANCE]] to [assign] [[ADDR]]
|
||||
// CHECK: [[PTR2:%[^,]+]] = struct_extract [[UMP]]
|
||||
// CHECK: [[ADDR2:%[^,]+]] = pointer_to_address [[PTR2]]
|
||||
// CHECK: [[OUT:%[^,]+]] = load [copy] [[ADDR2]]
|
||||
// CHECK: return [[OUT]]
|
||||
// CHECK-LABEL: } // end sil function 'write_to_pointer'
|
||||
@_silgen_name("write_to_pointer")
|
||||
public func write_to_pointer(o: consuming AnyObject, p: UnsafeMutablePointer<AnyObject>) -> AnyObject {
|
||||
public func write_to_pointer(o: consuming AnyObject, p: UnsafeMutablePointer<AnyObject>) -> () {
|
||||
// o should be destroyed here
|
||||
p.pointee = o
|
||||
return p.pointee
|
||||
}
|
||||
|
||||
extension C {
|
||||
@@ -87,16 +82,11 @@ extension C {
|
||||
// CHECK: [[PTR:%[^,]+]] = struct_extract [[UMP]]
|
||||
// CHECK: [[ADDR:%[^,]+]] = pointer_to_address [[PTR]]
|
||||
// CHECK: store [[INSTANCE]] to [assign] [[ADDR]]
|
||||
// CHECK: [[ADDR2:%[^,]+]] = struct_extract [[UMP]]
|
||||
// CHECK: [[PTR2:%[^,]+]] = pointer_to_address [[ADDR2]]
|
||||
// CHECK: [[OUT:%[^,]+]] = load [copy] [[PTR2]]
|
||||
// CHECK: return [[OUT]]
|
||||
// CHECK-LABEL: } // end sil function 'write_to_pointer_method'
|
||||
@_silgen_name("write_to_pointer_method")
|
||||
consuming
|
||||
public func write_to_pointer(p: UnsafeMutablePointer<C>) -> C {
|
||||
public func write_to_pointer(p: UnsafeMutablePointer<C>) -> () {
|
||||
// o should be destroyed here
|
||||
p.pointee = self
|
||||
return p.pointee
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,11 +33,11 @@ public func noInlineNoEffects(_ x: X) -> Int {
|
||||
return x.i
|
||||
}
|
||||
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] @$s6Module15inlineNoEffectsySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] {{.*}}@$s6Module15inlineNoEffectsySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-FR-MODULE-NEXT: [%0: noescape **, read c0.v**]
|
||||
// CHECK-FR-MODULE-NEXT: [global: ]
|
||||
// CHECK-FR-MODULE-NEXT: {{^[^[]}}
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] @$s6Module15inlineNoEffectsySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] {{.*}}@$s6Module15inlineNoEffectsySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-LE-MODULE-NEXT: {{^[^[]}}
|
||||
@inlinable
|
||||
@inline(never)
|
||||
@@ -65,11 +65,11 @@ public func noInlineWithEffects(_ x: X) -> Int {
|
||||
return x.i
|
||||
}
|
||||
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] @$s6Module17inlineWithEffectsySiAA1XCF :
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] {{.*}}@$s6Module17inlineWithEffectsySiAA1XCF :
|
||||
// CHECK-FR-MODULE-NEXT: [%0: noescape! **, read c0.v**]
|
||||
// CHECK-FR-MODULE-NEXT: [global: ]
|
||||
// CHECK-FR-MODULE-NEXT: {{^[^[]}}
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] @$s6Module17inlineWithEffectsySiAA1XCF :
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] {{.*}}@$s6Module17inlineWithEffectsySiAA1XCF :
|
||||
// CHECK-LE-MODULE-NEXT: [%0: noescape! **]
|
||||
// CHECK-LE-MODULE-NEXT: {{^[^[]}}
|
||||
@inlinable
|
||||
@@ -79,15 +79,15 @@ public func inlineWithEffects(_ x: X) -> Int {
|
||||
return internalCallee(x)
|
||||
}
|
||||
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] @loadWeakX_from : {{.*}} {
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] [ossa] @loadWeakX_from : {{.*}} {
|
||||
// CHECK-LE-MODULE: {{^[^[]}}
|
||||
// CHECK-LE-MODULE-LABEL: } // end sil function 'loadWeakX_from'
|
||||
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] @$s6Module12simpleInlineySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] [ossa] @$s6Module12simpleInlineySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-FR-MODULE-NEXT: [%0: noescape **, read c0.v**]
|
||||
// CHECK-FR-MODULE-NEXT: [global: ]
|
||||
// CHECK-FR-MODULE-NEXT: {{^[^[]}}
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] @$s6Module12simpleInlineySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-LE-MODULE-LABEL: sil [serialized] [noinline] [canonical] [ossa] @$s6Module12simpleInlineySiAA1XCF : $@convention(thin) (@guaranteed X) -> Int {
|
||||
// CHECK-LE-MODULE-NEXT: {{^[^[]}}
|
||||
@inlinable
|
||||
@inline(never)
|
||||
@@ -100,7 +100,7 @@ public struct S {
|
||||
public weak var x: X?
|
||||
}
|
||||
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] @loadWeakX_from : {{.*}} {
|
||||
// CHECK-FR-MODULE-LABEL: sil [serialized] [noinline] [canonical] [ossa] @loadWeakX_from : {{.*}} {
|
||||
// CHECK-FR-MODULE: [global: deinit_barrier]
|
||||
// CHECK-FR-MODULE-LABEL: } // end sil function 'loadWeakX_from'
|
||||
@inlinable
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-frontend -O -emit-sil -parse-as-library %s | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -O -emit-sil -parse-as-library %s | grep -v debug_value | %FileCheck %s
|
||||
|
||||
// REQUIRES: swift_stdlib_no_asserts,optimized_stdlib
|
||||
// REQUIRES: swift_in_compiler
|
||||
@@ -28,7 +28,6 @@ func g<T : P>(_ x : T) -> Bool {
|
||||
|
||||
// CHECK-LABEL: sil @$s10dead_alloc0A10AllocStackySbAA1XVF :
|
||||
// CHECK: bb0({{.*}}):
|
||||
// CHECK-NEXT: debug_value
|
||||
// CHECK-NEXT: integer_literal
|
||||
// CHECK-NEXT: struct
|
||||
// CHECK-NEXT: return
|
||||
@@ -52,7 +51,6 @@ public func deadClassInstance() {
|
||||
|
||||
// CHECK-LABEL: sil @$s10dead_alloc0A13ManagedBufferyyF :
|
||||
// CHECK: bb0:
|
||||
// CHECK-NEXT: debug_value undef
|
||||
// CHECK-NEXT: tuple
|
||||
// CHECK-NEXT: return
|
||||
// CHECK-NEXT: } // end sil function '$s10dead_alloc0A13ManagedBufferyyF'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// RUN: %target-swift-frontend -O -module-name=test -emit-sil %s | %FileCheck %s
|
||||
// RUN: %target-swift-frontend -O -module-name=test -emit-sil %s | grep -v debug_value | %FileCheck %s
|
||||
|
||||
// REQUIRES: objc_interop
|
||||
|
||||
@@ -10,7 +10,6 @@ class Myclass : NSObject {
|
||||
|
||||
// CHECK-LABEL: sil private [thunk] {{.*}}@$s4test7MyclassC3fooyySSFTo
|
||||
// CHECK: bb0(%0 : $NSString, %1 : $Myclass):
|
||||
// CHECK-NEXT: debug_value
|
||||
// CHECK-NEXT: tuple ()
|
||||
// CHECK-NEXT: return
|
||||
@objc func foo(_ s: String) {
|
||||
|
||||
@@ -35,7 +35,7 @@ public func publicWrapper(somethingGood: Bool) throws -> Int {
|
||||
// CHECK: [[F:%[0-9]+]] = function_ref @$s4test22internalImplementation13somethingGoods6ResultOySis5Error_pGSb_tF
|
||||
// CHECK: apply [[F]]
|
||||
// CHECK: switch_enum
|
||||
// CHECK: bb1:
|
||||
// CHECK: bb1({{%.*}} : $Int):
|
||||
// CHECK-NOT: alloc_existential_box
|
||||
// CHECK: } // end sil function '$s4test0A13WithForceCast13somethingGoodSiSb_tF'
|
||||
@inline(never)
|
||||
@@ -51,7 +51,7 @@ public func testWithForceCast(somethingGood: Bool) -> Int {
|
||||
// CHECK: [[F:%[0-9]+]] = function_ref @$s4test22internalImplementation13somethingGoods6ResultOySis5Error_pGSb_tF
|
||||
// CHECK: apply [[F]]
|
||||
// CHECK: switch_enum
|
||||
// CHECK: bb1:
|
||||
// CHECK: bb1({{%.*}} : $Int):
|
||||
// CHECK-NOT: alloc_existential_box
|
||||
// CHECK: } // end sil function '$s4test0A19WithMultipleCatches13somethingGoodSiSb_tF'
|
||||
@inline(never)
|
||||
|
||||
@@ -46,9 +46,6 @@ public func caller_guaranteed_eagerMove(s: S) {
|
||||
// CHECK-LABEL: sil {{.*}}@$s4main22callee_owned_eagerMoveyyAA1P_pnFTf4e_nTf4g_n : {{.*}}{
|
||||
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @_eagerMove $
|
||||
// CHECK-LABEL: } // end sil function '$s4main22callee_owned_eagerMoveyyAA1P_pnFTf4e_nTf4g_n'
|
||||
// CHECK-LABEL: sil {{.*}}@$s4main22callee_owned_eagerMoveyyAA1P_pnFTf4e_nAA1SV_Tg5Tf4gX_n : {{.*}}{
|
||||
// CHECK: {{bb[0-9]+}}({{%[^,]+}} : @_eagerMove $
|
||||
// CHECK-LABEL: } // end sil function '$s4main22callee_owned_eagerMoveyyAA1P_pnFTf4e_nAA1SV_Tg5Tf4gX_n'
|
||||
@inline(never)
|
||||
func callee_owned_eagerMove(@_eagerMove _ p: __owned P) {
|
||||
p.foo()
|
||||
|
||||
@@ -32,14 +32,14 @@ public func reproduce(_ e: Something) {
|
||||
}
|
||||
|
||||
// use(_:)
|
||||
// CHECK: sil [serialized_for_package] [canonical] @$s3Lib3useyySiyXEF : $@convention(thin) (@guaranteed @noescape @callee_guaranteed () -> Int) -> () {
|
||||
// CHECK: bb0(%0 : $@noescape @callee_guaranteed () -> Int):
|
||||
// CHECK: sil [serialized_for_package] [canonical] [ossa] @$s3Lib3useyySiyXEF : $@convention(thin) (@guaranteed @noescape @callee_guaranteed () -> Int) -> () {
|
||||
// CHECK: bb0(%0 : @guaranteed $@noescape @callee_guaranteed () -> Int):
|
||||
// CHECK: [[RESULT:%.*]] = tuple ()
|
||||
// CHECK: return [[RESULT]] : $()
|
||||
// CHECK: } // end sil function '$s3Lib3useyySiyXEF'
|
||||
|
||||
// closure #1 in reproduce(_:)
|
||||
// CHECK: sil shared [serialized] [canonical] @$s3Lib9reproduceyyAA9SomethingVFSiyXEfU_ : $@convention(thin) (@in_guaranteed Something) -> Int {
|
||||
// CHECK: sil shared [serialized] [canonical] [ossa] @$s3Lib9reproduceyyAA9SomethingVFSiyXEfU_ : $@convention(thin) (@in_guaranteed Something) -> Int {
|
||||
// function_ref Something.f()
|
||||
// CHECK: bb0(%0 : @closureCapture $*Something):
|
||||
// CHECK: [[REF:%.*]] = function_ref @$s3Lib9SomethingV1fSiyF : $@convention(method) (@in_guaranteed Something) -> Int
|
||||
@@ -48,13 +48,13 @@ public func reproduce(_ e: Something) {
|
||||
// CHECK: } // end sil function '$s3Lib9reproduceyyAA9SomethingVFSiyXEfU_'
|
||||
|
||||
// Something.f()
|
||||
// CHECK: sil [serialized_for_package] [canonical] @$s3Lib9SomethingV1fSiyF : $@convention(method) (@in_guaranteed Something) -> Int {
|
||||
// CHECK: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9SomethingV1fSiyF : $@convention(method) (@in_guaranteed Something) -> Int {
|
||||
|
||||
// Something.init()
|
||||
// CHECK: sil [serialized_for_package] [canonical] @$s3Lib9SomethingVACycfC : $@convention(method) (@thin Something.Type) -> @out Something {
|
||||
// CHECK: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9SomethingVACycfC : $@convention(method) (@thin Something.Type) -> @out Something {
|
||||
|
||||
// reproduce(_:)
|
||||
// CHECK: sil [serialized] [canonical] @$s3Lib9reproduceyyAA9SomethingVF : $@convention(thin) (@in_guaranteed Something) -> () {
|
||||
// CHECK: sil [serialized] [canonical] [ossa] @$s3Lib9reproduceyyAA9SomethingVF : $@convention(thin) (@in_guaranteed Something) -> () {
|
||||
// CHECK: bb0(%0 : $*Something):
|
||||
// CHECK: [[CLOSURE_PTR:%.*]] = function_ref @$s3Lib9reproduceyyAA9SomethingVFSiyXEfU_ : $@convention(thin) (@in_guaranteed Something) -> Int
|
||||
// CHECK: [[CLOSURE_W_ARG:%.*]] = partial_apply [callee_guaranteed] [on_stack] [[CLOSURE_PTR]](%0) : $@convention(thin) (@in_guaranteed Something) -> Int
|
||||
|
||||
@@ -69,11 +69,11 @@
|
||||
/// Verify functions and tables are optimized with Package CMO in Lib.
|
||||
// RUN: %FileCheck -check-prefix=CHECK-LIB %s < %t/Lib.sil
|
||||
|
||||
// CHECK-LIB: sil [serialized] [exact_self_class] [canonical] @$s3Lib3PubCyACSicfC : $@convention(method) (Int, @thick Pub.Type) -> @owned Pub {
|
||||
// CHECK-LIB: sil [serialized] [exact_self_class] [canonical] [ossa] @$s3Lib3PubCyACSicfC : $@convention(method) (Int, @thick Pub.Type) -> @owned Pub {
|
||||
// CHECK-LIB: function_ref @$s3Lib3PubCyACSicfc : $@convention(method) (Int, @owned Pub) -> @owned Pub
|
||||
|
||||
// Pub.pkgVar.getter
|
||||
// CHECK-LIB: sil package [serialized_for_package] [canonical] @$s3Lib3PubC6pkgVarSivg : $@convention(method) (@guaranteed Pub) -> Int {
|
||||
// CHECK-LIB: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib3PubC6pkgVarSivg : $@convention(method) (@guaranteed Pub) -> Int {
|
||||
|
||||
// CHECK-LIB: sil_vtable [serialized_for_package] Pub {
|
||||
// CHECK-LIB: #Pub.pubVar!getter: (Pub) -> () -> Int : @$s3Lib3PubC6pubVarSivg // Pub.pubVar.getter
|
||||
|
||||
@@ -76,30 +76,30 @@ package func usePkgStruct(_ arg: Int) -> PkgStruct {
|
||||
|
||||
//--- Lib.swift
|
||||
|
||||
// CHECK: sil package [serialized_for_package] [canonical] @$s3Lib6libPkgyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PkgStruct {
|
||||
// CHECK: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib6libPkgyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PkgStruct {
|
||||
// CHECK: struct $PkgStruct
|
||||
// CHECK: store {{.*}} to %0 : $*PkgStruct
|
||||
// CHECK: store {{.*}} to [trivial] %0 : $*PkgStruct
|
||||
|
||||
// CHECK: sil [serialized_for_package] [canonical] @$s3Lib6libPubyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PubStruct {
|
||||
// CHECK: sil [serialized_for_package] [canonical] [ossa] @$s3Lib6libPubyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PubStruct {
|
||||
// CHECK: struct $PubStruct
|
||||
// CHECK: store {{.*}} to %0 : $*PubStruct
|
||||
// CHECK: store {{.*}} to [trivial] %0 : $*PubStruct
|
||||
|
||||
// CHECK: sil package [serialized_for_package] [canonical] @$s3Lib9libUfiPkgyAA0cD6StructVSiF : $@convention(thin) (Int) -> @out UfiPkgStruct {
|
||||
// CHECK: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib9libUfiPkgyAA0cD6StructVSiF : $@convention(thin) (Int) -> @out UfiPkgStruct {
|
||||
// CHECK: struct $UfiPkgStruct
|
||||
// CHECK: store {{.*}} to %0 : $*UfiPkgStruct
|
||||
// CHECK: store {{.*}} to [trivial] %0 : $*UfiPkgStruct
|
||||
|
||||
/// @inlinable package func inLibUfiPkg(_ arg: Int) -> UfiPkgStruct
|
||||
// CHECK: sil [serialized] [canonical] @$s3Lib02inA6UfiPkgyAA0cD6StructVSiF : $@convention(thin) (Int) -> @out UfiPkgStruct {
|
||||
// CHECK: sil [serialized] [canonical] [ossa] @$s3Lib02inA6UfiPkgyAA0cD6StructVSiF : $@convention(thin) (Int) -> @out UfiPkgStruct {
|
||||
// CHECK: function_ref @$s3Lib12UfiPkgStructVyACSicfC : $@convention(method) (Int, @thin UfiPkgStruct.Type) -> @out UfiPkgStruct
|
||||
// CHECK: function_ref @$s3Lib12UfiPkgStructV03ufiC0SivM : $@yield_once @convention(method) (@inout UfiPkgStruct) -> @yields @inout Int
|
||||
|
||||
/// @inlinable func inLibUfiHid(_ arg: Int) -> UfiHidStruct
|
||||
// CHECK: sil [serialized] [canonical] @$s3Lib02inA6UfiHidyAA0cD6StructVSiF : $@convention(thin) (Int) -> @out UfiHidStruct {
|
||||
// CHECK: sil [serialized] [canonical] [ossa] @$s3Lib02inA6UfiHidyAA0cD6StructVSiF : $@convention(thin) (Int) -> @out UfiHidStruct {
|
||||
// CHECK: function_ref @$s3Lib12UfiHidStructVyACSicfC : $@convention(method) (Int, @thin UfiHidStruct.Type) -> @out UfiHidStruct
|
||||
// CHECK: function_ref @$s3Lib12UfiHidStructV03ufiC0SivM : $@yield_once @convention(method) (@inout UfiHidStruct) -> @yields @inout Int
|
||||
|
||||
/// @inlinable public func inLibPub(_ arg: Int) -> PubStruct
|
||||
// CHECK: sil [serialized] [canonical] @$s3Lib02inA3PubyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PubStruct {
|
||||
// CHECK: sil [serialized] [canonical] [ossa] @$s3Lib02inA3PubyAA0C6StructVSiF : $@convention(thin) (Int) -> @out PubStruct {
|
||||
// CHECK: function_ref @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> @out PubStruct
|
||||
// CHECK: function_ref @$s3Lib9PubStructV3pubSivM : $@yield_once @convention(method) (@inout PubStruct) -> @yields @inout Int
|
||||
|
||||
|
||||
@@ -27,27 +27,27 @@ package struct PkgStruct {
|
||||
}
|
||||
|
||||
/// BEFORE perf inlining pass.
|
||||
// CHECK: sil package @$s3Lib3fooyS2iF : $@convention(thin) (Int) -> Int {
|
||||
// CHECK: sil package [ossa] @$s3Lib3fooyS2iF : $@convention(thin) (Int) -> Int {
|
||||
// CHECK: [[PKG_STACK:%.*]] = alloc_stack $PkgStruct
|
||||
// CHECK: [[FUNC_REF:%.*]] = function_ref @$s3Lib9PkgStructVyACSi_SitcfC : $@convention(method) (Int, Int, @thin PkgStruct.Type) -> @out PkgStruct
|
||||
// CHECK: apply [[FUNC_REF]]
|
||||
// CHECK: [[F1:%.*]] = struct_element_addr [[PKG_STACK]] : $*PkgStruct, #PkgStruct.field1
|
||||
// CHECK: load [[F1]] : $*Int
|
||||
// CHECK: load [trivial] [[F1]] : $*Int
|
||||
// CHECK: [[F2:%.*]] = struct_element_addr [[PKG_STACK]] : $*PkgStruct, #PkgStruct.field2
|
||||
// CHECK: load [[F2]] : $*Int
|
||||
// CHECK: load [trivial] [[F2]] : $*Int
|
||||
|
||||
/// AFTER perf inlining pass; body of `@$s3Lib9PkgStructVyACSi_SitcfC` gets inlined.
|
||||
// CHECK: *** SIL function after {{.*}} EarlyPerfInliner (early-inline)
|
||||
// CHECK: sil package @$s3Lib3fooyS2iF : $@convention(thin) (Int) -> Int {
|
||||
// CHECK: sil package [ossa] @$s3Lib3fooyS2iF : $@convention(thin) (Int) -> Int {
|
||||
// CHECK: [[PKG_ALLOC:%.*]] = alloc_stack $PkgStruct
|
||||
// CHECK: [[PKG_INIT:%.*]] = alloc_stack [var_decl] $PkgStruct, var, name "self"
|
||||
// CHECK: [[FIELD1_IVAR:%.*]] = struct_element_addr [[PKG_INIT]] : $*PkgStruct, #PkgStruct.field1
|
||||
// CHECK: store {{.*}} to [[FIELD1_IVAR]] : $*Int
|
||||
// CHECK: store {{.*}} to [trivial] [[FIELD1_IVAR]] : $*Int
|
||||
// CHECK: [[FIELD2_IVAR:%.*]] = struct_element_addr [[PKG_INIT]] : $*PkgStruct, #PkgStruct.field2
|
||||
// CHECK: store {{.*}} to [[FIELD2_IVAR]] : $*Int
|
||||
// CHECK: store {{.*}} to [trivial] [[FIELD2_IVAR]] : $*Int
|
||||
// CHECK: [[PKG_STR:%.*]] = struct $PkgStruct
|
||||
// CHECK: store [[PKG_STR]] to [[PKG_ALLOC]] : $*PkgStruct
|
||||
// CHECK: store [[PKG_STR]] to [trivial] [[PKG_ALLOC]] : $*PkgStruct
|
||||
// CHECK: [[FIELD1:%.*]] = struct_element_addr [[PKG_ALLOC]] : $*PkgStruct, #PkgStruct.field1
|
||||
// CHECK: load [[FIELD1]] : $*Int
|
||||
// CHECK: load [trivial] [[FIELD1]] : $*Int
|
||||
// CHECK: [[FIELD2:%.*]] = struct_element_addr [[PKG_ALLOC]] : $*PkgStruct, #PkgStruct.field2
|
||||
// CHECK: load [[FIELD2]] : $*Int
|
||||
// CHECK: load [trivial] [[FIELD2]] : $*Int
|
||||
|
||||
@@ -221,14 +221,14 @@ public func mainPub() {
|
||||
|
||||
public struct PubStruct {
|
||||
// PubStruct.foovar.getter
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib9PubStructV6fooVarSivg : $@convention(method) (@in_guaranteed PubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9PubStructV6fooVarSivg : $@convention(method) (@in_guaranteed PubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [transparent] [serialized] [canonical] [ossa] @$s3Lib9PubStructV6fooVarSivg : $@convention(method) (PubStruct) -> Int
|
||||
// CHECK-RES-DAG: [[PUB_GET:%.*]] = struct_element_addr {{.*}} : $*PubStruct, #PubStruct.fooVar
|
||||
// CHECK-RES-DAG: load [[PUB_GET]] : $*Int
|
||||
// CHECK-RES-DAG: load [trivial] [[PUB_GET]] : $*Int
|
||||
// CHECK-NONRES-DAG = struct_extract {{.*}} : $PubStruct, #PubStruct.fooVar
|
||||
|
||||
// PubStruct.foovar.setter
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib9PubStructV6fooVarSivs : $@convention(method) (Int, @inout PubStruct) -> () {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9PubStructV6fooVarSivs : $@convention(method) (Int, @inout PubStruct) -> () {
|
||||
// CHECK-NONRES-DAG: sil [transparent] [serialized] [canonical] [ossa] @$s3Lib9PubStructV6fooVarSivs : $@convention(method) (Int, @inout PubStruct) -> () {
|
||||
|
||||
/// NOTE: loadable types (e.g. load/store `struct $PubStruct`) can be only allowed
|
||||
@@ -239,7 +239,7 @@ public struct PubStruct {
|
||||
// CHECK-NONRES-DAG: store [[PUB_SET]] to [trivial] {{.*}} : $*PubStruct
|
||||
|
||||
// PubStruct.foovar.modify
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib9PubStructV6fooVarSivM : $@yield_once @convention(method) (@inout PubStruct) -> @yields @inout Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9PubStructV6fooVarSivM : $@yield_once @convention(method) (@inout PubStruct) -> @yields @inout Int {
|
||||
// CHECK-NONRES-DAG: sil [transparent] [serialized] [canonical] [ossa] @$s3Lib9PubStructV6fooVarSivM : $@yield_once @convention(method) (@inout PubStruct) -> @yields @inout Int {
|
||||
// CHECK-COMMON-DAG: [[PUB_MODIFY:%.*]] = struct_element_addr {{.*}} : $*PubStruct, #PubStruct.fooVar
|
||||
// CHECK-COMMON-DAG: yield [[PUB_MODIFY]]
|
||||
@@ -257,7 +257,7 @@ public struct PubStruct {
|
||||
// CHECK-NONRES-DAG: function_ref @$s3Lib9PubStructV16pubStaticFuncPtrySiACcvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
|
||||
// PubStruct.pubStaticFuncPtr.unsafeMutableAddressor
|
||||
// CHECK-NONRES-DAG: sil [serialized] [global_init] [canonical] @$s3Lib9PubStructV16pubStaticFuncPtrySiACcvau : $@convention(thin) () -> Builtin.RawPointer {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [global_init] [canonical] [ossa] @$s3Lib9PubStructV16pubStaticFuncPtrySiACcvau : $@convention(thin) () -> Builtin.RawPointer {
|
||||
// CHECK-NONRES-DAG: [[PUB_FADDR:%.*]] = global_addr @$s3Lib9PubStructV16pubStaticFuncPtrySiACcvpZ : $*@callee_guaranteed (PubStruct) -> Int
|
||||
// CHECK-NONRES-DAG: address_to_pointer [[PUB_FADDR]] : $*@callee_guaranteed (PubStruct) -> Int to $Builtin.RawPointer
|
||||
|
||||
@@ -268,7 +268,7 @@ public struct PubStruct {
|
||||
// CHECK-NONRES-DAG: function_ref @$s3Lib9PubStructV25pubStaticSimpleClosurePtryS2icvau : $@convention(thin) () -> Builtin.RawPointer
|
||||
|
||||
// PubStruct.pubStaticSimpleClosurePtr.unsafeMutableAddressor
|
||||
// CHECK-NONRES-DAG: sil [serialized] [global_init] [canonical] @$s3Lib9PubStructV25pubStaticSimpleClosurePtryS2icvau : $@convention(thin) () -> Builtin.RawPointer {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [global_init] [canonical] [ossa] @$s3Lib9PubStructV25pubStaticSimpleClosurePtryS2icvau : $@convention(thin) () -> Builtin.RawPointer {
|
||||
// CHECK-NONRES-DAG: global_addr @$s3Lib9PubStructV25pubStaticSimpleClosurePtryS2icvpZ : $*@callee_guaranteed (Int) -> Int
|
||||
public static var pubStaticSimpleClosurePtr: (Int) -> (Int) = { return $0 }
|
||||
|
||||
@@ -278,27 +278,27 @@ public struct PubStruct {
|
||||
// CHECK-NONRES-DAG: function_ref @$s3Lib9PubStructV19pubStaticClosurePtrySiACcvau : $@convention(thin)
|
||||
|
||||
// PubStruct.pubStaticClosurePtr.unsafeMutableAddressor
|
||||
// CHECK-NONRES-DAG: sil [serialized] [global_init] [canonical] @$s3Lib9PubStructV19pubStaticClosurePtrySiACcvau : $@convention(thin) () -> Builtin.RawPointer {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [global_init] [canonical] [ossa] @$s3Lib9PubStructV19pubStaticClosurePtrySiACcvau : $@convention(thin) () -> Builtin.RawPointer {
|
||||
// CHECK-NONRES-DAG: [[PUB_CADDR:%.*]] = global_addr @$s3Lib9PubStructV19pubStaticClosurePtrySiACcvpZ : $*@callee_guaranteed (PubStruct) -> Int
|
||||
// CHECK-NONRES-DAG: address_to_pointer [[PUB_CADDR]] : $*@callee_guaranteed (PubStruct) -> Int to $Builtin.RawPointer
|
||||
public static var pubStaticClosurePtr: (PubStruct) -> (Int) = { return $0.fooVar }
|
||||
|
||||
// static PubStruct.pubStaticFunc()
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib9PubStructV13pubStaticFuncAA0B5KlassCyFZ : $@convention(method) (@thin PubStruct.Type) -> @owned PubKlass {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib9PubStructV13pubStaticFuncAA0B5KlassCyFZ : $@convention(method) (@thin PubStruct.Type) -> @owned PubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9PubStructV13pubStaticFuncAA0B5KlassCyFZ : $@convention(method) (@thin PubStruct.Type) -> @owned PubKlass {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib9PubStructV13pubStaticFuncAA0B5KlassCyFZ : $@convention(method) (@thin PubStruct.Type) -> @owned PubKlass {
|
||||
public static func pubStaticFunc() -> PubKlass { return PubKlass() }
|
||||
|
||||
public init(_ arg: Int) {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> @out PubStruct {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> PubStruct {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> @out PubStruct {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib9PubStructVyACSicfC : $@convention(method) (Int, @thin PubStruct.Type) -> PubStruct {
|
||||
// CHECK-COMMON-DAG: [[PUB_INIT:%.*]] = struct $PubStruct
|
||||
// CHECK-RES-DAG: store [[PUB_INIT]] to {{.*}} : $*PubStruct
|
||||
// CHECK-NONRES-DAG: return [[PUB_INIT]] : $PubStruct
|
||||
fooVar = arg
|
||||
}
|
||||
public func f() -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib9PubStructV1fSiyF : $@convention(method) (@in_guaranteed PubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib9PubStructV1fSiyF : $@convention(method) (PubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib9PubStructV1fSiyF : $@convention(method) (@in_guaranteed PubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib9PubStructV1fSiyF : $@convention(method) (PubStruct) -> Int {
|
||||
return fooVar > 7 ? fooVar : fooVar + 11
|
||||
}
|
||||
}
|
||||
@@ -308,8 +308,8 @@ public func runPubSimple(_ arg: Int) -> Int {
|
||||
}
|
||||
|
||||
public func runPub(_ arg: PubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib6runPubySiAA0C6StructVF : $@convention(thin) (@in_guaranteed PubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib6runPubySiAA0C6StructVF : $@convention(thin) (PubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib6runPubySiAA0C6StructVF : $@convention(thin) (@in_guaranteed PubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib6runPubySiAA0C6StructVF : $@convention(thin) (PubStruct) -> Int {
|
||||
return arg.f() > arg.fooVar ? arg.f() : arg.fooVar
|
||||
}
|
||||
|
||||
@@ -346,38 +346,38 @@ public struct FrPubStruct {
|
||||
public static var pubStaticClosurePtr: (PubStruct) -> (Int) = { return $0.fooVar }
|
||||
|
||||
public init(_ arg: Int) {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib11FrPubStructVyACSicfC : $@convention(method) (Int, @thin FrPubStruct.Type) -> FrPubStruct {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib11FrPubStructVyACSicfC : $@convention(method) (Int, @thin FrPubStruct.Type) -> FrPubStruct {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib11FrPubStructVyACSicfC : $@convention(method) (Int, @thin FrPubStruct.Type) -> FrPubStruct {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib11FrPubStructVyACSicfC : $@convention(method) (Int, @thin FrPubStruct.Type) -> FrPubStruct {
|
||||
// CHECK-COMMON-DAG: [[FR_MODIFY:%.*]] = struct $FrPubStruct
|
||||
// CHECK-COMMON-DAG: return [[FR_MODIFY]] : $FrPubStruct
|
||||
fooVar = arg
|
||||
}
|
||||
public func f() -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib11FrPubStructV1fSiyF : $@convention(method) (FrPubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib11FrPubStructV1fSiyF : $@convention(method) (FrPubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib11FrPubStructV1fSiyF : $@convention(method) (FrPubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib11FrPubStructV1fSiyF : $@convention(method) (FrPubStruct) -> Int {
|
||||
return fooVar > 13 ? fooVar : fooVar + 17
|
||||
}
|
||||
}
|
||||
|
||||
public func runFrPub(_ arg: FrPubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8runFrPubySiAA0cD6StructVF : $@convention(thin) (FrPubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib8runFrPubySiAA0cD6StructVF : $@convention(thin) (FrPubStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8runFrPubySiAA0cD6StructVF : $@convention(thin) (FrPubStruct) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib8runFrPubySiAA0cD6StructVF : $@convention(thin) (FrPubStruct) -> Int {
|
||||
return arg.f() > arg.fooVar ? arg.f() : arg.fooVar
|
||||
}
|
||||
|
||||
package struct PkgStruct {
|
||||
// PkgStruct.fooVar.getter
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib9PkgStructV6fooVarSivg : $@convention(method) (@in_guaranteed PkgStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib9PkgStructV6fooVarSivg : $@convention(method) (@in_guaranteed PkgStruct) -> Int {
|
||||
// CHECK-RES-DAG: [[PKG_GET:%.*]] = struct_element_addr {{.*}} : $*PkgStruct, #PkgStruct.fooVar
|
||||
// CHECK-RES-DAG: load [[PKG_GET]] : $*Int
|
||||
// CHECK-RES-DAG: load [trivial] [[PKG_GET]] : $*Int
|
||||
|
||||
// PkgStruct.fooVar.setter
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib9PkgStructV6fooVarSivs : $@convention(method) (Int, @inout PkgStruct) -> () {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib9PkgStructV6fooVarSivs : $@convention(method) (Int, @inout PkgStruct) -> () {
|
||||
// CHECK-RES-DAG: [[PKG_SET:%.*]] = struct $PkgStruct
|
||||
// CHECK-RES-DAG: store [[PKG_SET]] to {{.*}} : $*PkgStruct
|
||||
|
||||
// PkgStruct.fooVar.modify
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib9PkgStructV6fooVarSivM : $@yield_once @convention(method) (@inout PkgStruct) -> @yields @inout Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib9PkgStructV6fooVarSivM : $@yield_once @convention(method) (@inout PkgStruct) -> @yields @inout Int {
|
||||
package var fooVar: Int
|
||||
|
||||
package static var pkgStaticVar: String { "StaticPkgVar" }
|
||||
@@ -387,19 +387,19 @@ package struct PkgStruct {
|
||||
package static var pkgStaticClosurePtr: (PkgStruct) -> (Int) = { return $0.fooVar }
|
||||
|
||||
package init(_ arg: Int) {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib9PkgStructVyACSicfC : $@convention(method) (Int, @thin PkgStruct.Type) -> @out PkgStruct {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib9PkgStructVyACSicfC : $@convention(method) (Int, @thin PkgStruct.Type) -> @out PkgStruct {
|
||||
// CHECK-RES-DAG: [[PKG_INIT:%.*]] = struct $PkgStruct
|
||||
// CHECK-RES-DAG: store [[PKG_INIT]] to {{.*}} : $*PkgStruct
|
||||
fooVar = arg
|
||||
}
|
||||
package func f() -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib9PkgStructV1fSiyF : $@convention(method) (@in_guaranteed PkgStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib9PkgStructV1fSiyF : $@convention(method) (@in_guaranteed PkgStruct) -> Int {
|
||||
return fooVar > 19 ? fooVar : fooVar + 23
|
||||
}
|
||||
}
|
||||
|
||||
package func runPkg(_ arg: PkgStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib6runPkgySiAA0C6StructVF : $@convention(thin) (@in_guaranteed PkgStruct) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib6runPkgySiAA0C6StructVF : $@convention(thin) (@in_guaranteed PkgStruct) -> Int {
|
||||
return arg.f() > arg.fooVar ? arg.f() : arg.fooVar
|
||||
}
|
||||
|
||||
@@ -416,38 +416,38 @@ public class PubKlass: PubProto {
|
||||
// CHECK-NONRES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivgTW : $@convention(witness_method: PubProto) (@in_guaranteed PubKlass) -> Int {
|
||||
// CHECK-NONRES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivMTW : $@yield_once @convention(witness_method: PubProto) @substituted <τ_0_0> (@inout τ_0_0) -> @yields @inout Int for <PubKlass> {
|
||||
// CHECK-NONRES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PubKlassCAA0B5ProtoA2aDP4dataSivsTW : $@convention(witness_method: PubProto) (Int, @inout PubKlass) -> () {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8PubKlassC4dataSivg : $@convention(method) (@guaranteed PubKlass) -> Int
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8PubKlassC4dataSivg : $@convention(method) (@guaranteed PubKlass) -> Int
|
||||
// CHECK-NONRES-DAG: sil [transparent] [serialized] [canonical] [ossa] @$s3Lib8PubKlassC4dataSivg : $@convention(method) (@guaranteed PubKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8PubKlassC4dataSivs : $@convention(method) (Int, @guaranteed PubKlass) -> () {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8PubKlassC4dataSivs : $@convention(method) (Int, @guaranteed PubKlass) -> () {
|
||||
// CHECK-NONRES-DAG: sil [transparent] [serialized] [canonical] [ossa] @$s3Lib8PubKlassC4dataSivs : $@convention(method) (Int, @guaranteed PubKlass) -> () {
|
||||
public var data: Int
|
||||
public init(_ arg: Int = 1) {
|
||||
// default argument 0 of PubKlass.init(_:)
|
||||
// CHECK-RES-DAG: sil non_abi [serialized] [canonical] @$s3Lib8PubKlassCyACSicfcfA_ : $@convention(thin) () -> Int {
|
||||
// CHECK-NONRES-DAG: sil non_abi [serialized] [canonical] @$s3Lib8PubKlassCyACSicfcfA_ : $@convention(thin) () -> Int {
|
||||
// CHECK-RES-DAG: sil non_abi [serialized] [canonical] [ossa] @$s3Lib8PubKlassCyACSicfcfA_ : $@convention(thin) () -> Int {
|
||||
// CHECK-NONRES-DAG: sil non_abi [serialized] [canonical] [ossa] @$s3Lib8PubKlassCyACSicfcfA_ : $@convention(thin) () -> Int {
|
||||
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8PubKlassCyACSicfc : $@convention(method) (Int, @owned PubKlass) -> @owned PubKlass {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib8PubKlassCyACSicfc : $@convention(method) (Int, @owned PubKlass) -> @owned PubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized] [exact_self_class] [canonical] @$s3Lib8PubKlassCyACSicfC : $@convention(method) (Int, @thick PubKlass.Type) -> @owned PubKlass {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [exact_self_class] [canonical] @$s3Lib8PubKlassCyACSicfC : $@convention(method) (Int, @thick PubKlass.Type) -> @owned PubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8PubKlassCfD : $@convention(method) (@owned PubKlass) -> () {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib8PubKlassCfD : $@convention(method) (@owned PubKlass) -> () {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8PubKlassCfd : $@convention(method) (@guaranteed PubKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib8PubKlassCfd : $@convention(method) (@guaranteed PubKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8PubKlassCyACSicfc : $@convention(method) (Int, @owned PubKlass) -> @owned PubKlass {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib8PubKlassCyACSicfc : $@convention(method) (Int, @owned PubKlass) -> @owned PubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized] [exact_self_class] [canonical] [ossa] @$s3Lib8PubKlassCyACSicfC : $@convention(method) (Int, @thick PubKlass.Type) -> @owned PubKlass {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [exact_self_class] [canonical] [ossa] @$s3Lib8PubKlassCyACSicfC : $@convention(method) (Int, @thick PubKlass.Type) -> @owned PubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8PubKlassCfD : $@convention(method) (@owned PubKlass) -> () {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib8PubKlassCfD : $@convention(method) (@owned PubKlass) -> () {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8PubKlassCfd : $@convention(method) (@guaranteed PubKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib8PubKlassCfd : $@convention(method) (@guaranteed PubKlass) -> @owned Builtin.NativeObject {
|
||||
self.data = arg
|
||||
}
|
||||
public func pubfunc(_ arg: Int) -> Int {
|
||||
// CHECK-RES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PubKlassCAA0B5ProtoA2aDP7pubfuncyS2iFTW : $@convention(witness_method: PubProto) (Int, @in_guaranteed PubKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib8PubKlassC7pubfuncyS2iF : $@convention(method) (Int, @guaranteed PubKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib8PubKlassC7pubfuncyS2iF : $@convention(method) (Int, @guaranteed PubKlass) -> Int {
|
||||
// CHECK-NONRES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PubKlassCAA0B5ProtoA2aDP7pubfuncyS2iFTW : $@convention(witness_method: PubProto) (Int, @in_guaranteed PubKlass) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib8PubKlassC7pubfuncyS2iF : $@convention(method) (Int, @guaranteed PubKlass) -> Int {
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib8PubKlassC7pubfuncyS2iF : $@convention(method) (Int, @guaranteed PubKlass) -> Int {
|
||||
return data + arg
|
||||
}
|
||||
}
|
||||
|
||||
public func runPubKlass(_ arg: PubKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib11runPubKlassySiAA0cD0CF : $@convention(thin) (@guaranteed PubKlass) -> Int
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] @$s3Lib11runPubKlassySiAA0cD0CF : $@convention(thin) (@guaranteed PubKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib11runPubKlassySiAA0cD0CF : $@convention(thin) (@guaranteed PubKlass) -> Int
|
||||
// CHECK-NONRES-DAG: sil [serialized] [canonical] [ossa] @$s3Lib11runPubKlassySiAA0cD0CF : $@convention(thin) (@guaranteed PubKlass) -> Int {
|
||||
arg.data += 29
|
||||
return arg.pubfunc(31)
|
||||
}
|
||||
@@ -457,13 +457,13 @@ final public class FinalPubKlass {
|
||||
// CHECK-RES-DAG: sil [transparent] [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPubKlassC4dataSivpfi : $@convention(thin) () -> Int {
|
||||
public var data = 1
|
||||
// FinalPubKlass.__allocating_init(_:)
|
||||
// CHECK-RES-DAG: sil [serialized] [exact_self_class] [canonical] @$s3Lib13FinalPubKlassCyACSicfC : $@convention(method) (Int, @thick FinalPubKlass.Type) -> @owned FinalPubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized] [exact_self_class] [canonical] [ossa] @$s3Lib13FinalPubKlassCyACSicfC : $@convention(method) (Int, @thick FinalPubKlass.Type) -> @owned FinalPubKlass {
|
||||
// FinalPubKlass.init(_:)
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib13FinalPubKlassCyACSicfc : $@convention(method) (Int, @owned FinalPubKlass) -> @owned FinalPubKlass {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPubKlassCyACSicfc : $@convention(method) (Int, @owned FinalPubKlass) -> @owned FinalPubKlass {
|
||||
// FinalPubKlass.__deallocating_deinit
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib13FinalPubKlassCfD : $@convention(method) (@owned FinalPubKlass) -> () {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPubKlassCfD : $@convention(method) (@owned FinalPubKlass) -> () {
|
||||
// FinalPubKlass.deinit
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] @$s3Lib13FinalPubKlassCfd : $@convention(method) (@guaranteed FinalPubKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-RES-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPubKlassCfd : $@convention(method) (@guaranteed FinalPubKlass) -> @owned Builtin.NativeObject {
|
||||
public init(_ arg: Int) {
|
||||
data = arg
|
||||
}
|
||||
@@ -481,32 +481,32 @@ package class PkgKlass: PkgProto {
|
||||
// CHECK-RES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivgTW : $@convention(witness_method: PkgProto) (@in_guaranteed PkgKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivsTW : $@convention(witness_method: PkgProto) (Int, @inout PkgKlass) -> () {
|
||||
// CHECK-RES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PkgKlassCAA0B5ProtoA2aDP4dataSivMTW : $@yield_once @convention(witness_method: PkgProto) @substituted <τ_0_0> (@inout τ_0_0) -> @yields @inout Int for <PkgKlass> {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassC4dataSivM : $@yield_once @convention(method) (@guaranteed PkgKlass) -> @yields @inout Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassC4dataSivg : $@convention(method) (@guaranteed PkgKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassC4dataSivs : $@convention(method) (Int, @guaranteed PkgKlass) -> () {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassC4dataSivM : $@yield_once @convention(method) (@guaranteed PkgKlass) -> @yields @inout Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassC4dataSivg : $@convention(method) (@guaranteed PkgKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassC4dataSivs : $@convention(method) (Int, @guaranteed PkgKlass) -> () {
|
||||
package var data: Int
|
||||
|
||||
package init(_ arg: Int = 1) {
|
||||
// default argument 0 of PkgKlass.init(_:)
|
||||
// FIXME: package -> package_non_abi here? Also should this be [serialized] instead?
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassCyACSicfcfA_ : $@convention(thin) () -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassCyACSicfcfA_ : $@convention(thin) () -> Int {
|
||||
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassCyACSicfc : $@convention(method) (Int, @owned PkgKlass) -> @owned PkgKlass {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [exact_self_class] [canonical] @$s3Lib8PkgKlassCyACSicfC : $@convention(method) (Int, @thick PkgKlass.Type) -> @owned PkgKlass {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassCfd : $@convention(method) (@guaranteed PkgKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassCfD : $@convention(method) (@owned PkgKlass) -> ()
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassCyACSicfc : $@convention(method) (Int, @owned PkgKlass) -> @owned PkgKlass {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [exact_self_class] [canonical] [ossa] @$s3Lib8PkgKlassCyACSicfC : $@convention(method) (Int, @thick PkgKlass.Type) -> @owned PkgKlass {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassCfd : $@convention(method) (@guaranteed PkgKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassCfD : $@convention(method) (@owned PkgKlass) -> ()
|
||||
self.data = arg
|
||||
}
|
||||
|
||||
package func pkgfunc(_ arg: Int) -> Int {
|
||||
// CHECK-RES-DAG: sil shared [transparent] [serialized] [thunk] [canonical] [ossa] @$s3Lib8PkgKlassCAA0B5ProtoA2aDP7pkgfuncyS2iFTW : $@convention(witness_method: PkgProto) (Int, @in_guaranteed PkgKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib8PkgKlassC7pkgfuncyS2iF : $@convention(method) (Int, @guaranteed PkgKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib8PkgKlassC7pkgfuncyS2iF : $@convention(method) (Int, @guaranteed PkgKlass) -> Int {
|
||||
return data + arg
|
||||
}
|
||||
}
|
||||
|
||||
package func runPkgKlass(_ arg: PkgKlass) -> Int {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib11runPkgKlassySiAA0cD0CF : $@convention(thin) (@guaranteed PkgKlass) -> Int
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib11runPkgKlassySiAA0cD0CF : $@convention(thin) (@guaranteed PkgKlass) -> Int
|
||||
arg.data += 37
|
||||
return arg.pkgfunc(41)
|
||||
}
|
||||
@@ -518,13 +518,13 @@ final package class FinalPkgKlass {
|
||||
package var data = 1
|
||||
package init(_ arg: Int) {
|
||||
// FinalPkgKlass.__allocating_init(_:)
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [exact_self_class] [canonical] @$s3Lib13FinalPkgKlassCyACSicfC : $@convention(method) (Int, @thick FinalPkgKlass.Type) -> @owned FinalPkgKlass {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [exact_self_class] [canonical] [ossa] @$s3Lib13FinalPkgKlassCyACSicfC : $@convention(method) (Int, @thick FinalPkgKlass.Type) -> @owned FinalPkgKlass {
|
||||
// FinalPkgKlass.init(_:)
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib13FinalPkgKlassCyACSicfc : $@convention(method) (Int, @owned FinalPkgKlass) -> @owned FinalPkgKlass {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPkgKlassCyACSicfc : $@convention(method) (Int, @owned FinalPkgKlass) -> @owned FinalPkgKlass {
|
||||
// FinalPkgKlass.__deallocating_deinit
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib13FinalPkgKlassCfD : $@convention(method) (@owned FinalPkgKlass) -> () {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPkgKlassCfD : $@convention(method) (@owned FinalPkgKlass) -> () {
|
||||
// FinalPkgKlass.deinit
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] @$s3Lib13FinalPkgKlassCfd : $@convention(method) (@guaranteed FinalPkgKlass) -> @owned Builtin.NativeObject {
|
||||
// CHECK-RES-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib13FinalPkgKlassCfd : $@convention(method) (@guaranteed FinalPkgKlass) -> @owned Builtin.NativeObject {
|
||||
data = arg
|
||||
}
|
||||
package func fnlPkgFunc(_ arg: Int) -> Int {
|
||||
|
||||
@@ -121,17 +121,17 @@ public func useInternal(_ arg: Base) -> Int {
|
||||
return PubKlass().pkgVar + arg.baseVarInternal.data
|
||||
}
|
||||
|
||||
// CHECK-DAG: sil package [serialized_for_package] [canonical] @$s3Lib6usePkgySiAA4BaseCF : $@convention(thin) (@guaranteed Base) -> Int {
|
||||
// CHECK-DAG: sil package [serialized_for_package] [canonical] [ossa] @$s3Lib6usePkgySiAA4BaseCF : $@convention(thin) (@guaranteed Base) -> Int {
|
||||
package func usePkg(_ arg: Base) -> Int {
|
||||
return arg.baseVarPkg
|
||||
}
|
||||
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] @$s3Lib6usePubySiAA0C5KlassCF : $@convention(thin) (@guaranteed PubKlass) -> Int {
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib6usePubySiAA0C5KlassCF : $@convention(thin) (@guaranteed PubKlass) -> Int {
|
||||
public func usePub(_ arg: PubKlass) -> Int {
|
||||
return arg.pubVar + arg.pkgVar
|
||||
}
|
||||
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] @$s3Lib23usePubWithInternalFieldySiAA0c5KlassdE6MemberCF : $@convention(thin) (@guaranteed PubKlassWithInternalMember) -> Int {
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib23usePubWithInternalFieldySiAA0c5KlassdE6MemberCF : $@convention(thin) (@guaranteed PubKlassWithInternalMember) -> Int {
|
||||
public func usePubWithInternalField(_ arg: PubKlassWithInternalMember) -> Int {
|
||||
return arg.pubVar + arg.pkgVar
|
||||
}
|
||||
@@ -194,18 +194,18 @@ public class PubKlassWithInternalMember {
|
||||
}
|
||||
|
||||
// createPubClass<A>(_:)
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] @$s3Lib14createPubClassySixlF : $@convention(thin) <T> (@in_guaranteed T) -> Int {
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib14createPubClassySixlF : $@convention(thin) <T> (@in_guaranteed T) -> Int {
|
||||
public func createPubClass<T>(_ t: T) -> Int {
|
||||
return getPubClass(t).foo()
|
||||
}
|
||||
|
||||
// CHECK-DAG: sil [serialized_for_package] [_semantics "optimize.sil.specialize.generic.never"] [canonical] @$s3Lib20createPubClass_neverySixlF : $@convention(thin) <T> (@in_guaranteed T) -> Int {
|
||||
// CHECK-DAG: sil [serialized_for_package] [_semantics "optimize.sil.specialize.generic.never"] [canonical] [ossa] @$s3Lib20createPubClass_neverySixlF : $@convention(thin) <T> (@in_guaranteed T) -> Int {
|
||||
@_semantics("optimize.sil.specialize.generic.never")
|
||||
public func createPubClass_never<T>(_ t: T) -> Int {
|
||||
return getPubClass(t).foo()
|
||||
}
|
||||
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] @$s3Lib11getPubClassyAA13PublicDerivedCyxGxlF : $@convention(thin) <T> (@in_guaranteed T) -> @owned PublicDerived<T> {
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib11getPubClassyAA13PublicDerivedCyxGxlF : $@convention(thin) <T> (@in_guaranteed T) -> @owned PublicDerived<T> {
|
||||
public func getPubClass<T>(_ t : T) -> PublicDerived<T> {
|
||||
return PublicDerived<T>(t)
|
||||
}
|
||||
@@ -311,7 +311,7 @@ public func useInternalStructKeypath<T>(_ t: T) -> Int {
|
||||
return s[keyPath: getInternalStructKeypath(t)]
|
||||
}
|
||||
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] @$s3Lib19usePubStructKeypathySixlF : $@convention(thin) <T> (@in_guaranteed T) -> Int {
|
||||
// CHECK-DAG: sil [serialized_for_package] [canonical] [ossa] @$s3Lib19usePubStructKeypathySixlF : $@convention(thin) <T> (@in_guaranteed T) -> Int {
|
||||
public func usePubStructKeypath<T>(_ t: T) -> Int {
|
||||
let p = PubStruct()
|
||||
return p[keyPath: getPubStructKeypath(t)]
|
||||
|
||||
@@ -192,7 +192,6 @@ public func usePrespecializedEntryPoints(wrapperStruct: ReferenceWrapperStruct,
|
||||
// OPT: [[A2:%.*]] = load [[R1]] : $*SomeClass
|
||||
// OPT: [[F2:%.*]] = function_ref @$s22pre_specialize_layouts7consumeyyxlF0a20_specialized_module_C09SomeClassC_Ttg5 : $@convention(thin) () -> ()
|
||||
// OPT: apply [[F2]]() : $@convention(thin) () -> ()
|
||||
// OPT: strong_release [[A2]] : $SomeClass
|
||||
// OPT: dealloc_stack [[R1]] : $*SomeClass
|
||||
// OPT: } // end sil function '$s22pre_specialize_layouts46usePrespecializedEntryPointsWithMarkerProtocol1ty0a20_specialized_module_C09SomeClassC_tF'
|
||||
public func usePrespecializedEntryPointsWithMarkerProtocol(t: SomeClass) {
|
||||
|
||||
@@ -58,15 +58,13 @@ final class CC: PP {
|
||||
}
|
||||
}
|
||||
|
||||
// The first apply has been devirtualized and inlined. The second remains unspecialized.
|
||||
// CHECK-LABEL: sil @$s32sil_combine_concrete_existential29testWitnessReturnOptionalSelfAA2PP_pSgyF : $@convention(thin) () -> @owned Optional<any PP> {
|
||||
// CHECK: [[EI:%.*]] = end_init_let_ref %0
|
||||
// CHECK: [[E1:%.*]] = init_existential_ref [[EI]] : $CC : $CC, $any PP
|
||||
// CHECK: [[O1:%.*]] = open_existential_ref [[E1]] : $any PP to $@opened("{{.*}}", any PP) Self
|
||||
// CHECK: [[E2:%.*]] = init_existential_ref %{{.*}} : $@opened("{{.*}}", any PP) Self : $@opened("{{.*}}", any PP) Self, $any PP
|
||||
// CHECK: [[O2:%.*]] = open_existential_ref [[E2]] : $any PP to $@opened("{{.*}}", any PP) Self
|
||||
// CHECK: [[W:%.*]] = witness_method $@opened("{{.*}}", any PP) Self, #PP.returnOptionalSelf : <Self where Self : PP> (Self) -> () -> Self?, [[O1]] : $@opened("{{.*}}", any PP) Self : $@convention(witness_method: PP) <τ_0_0 where τ_0_0 : PP> (@guaranteed τ_0_0) -> @owned Optional<τ_0_0>
|
||||
// CHECK: apply [[W]]<@opened("{{.*}}", any PP) Self>([[O2]]) : $@convention(witness_method: PP) <τ_0_0 where τ_0_0 : PP> (@guaranteed τ_0_0) -> @owned Optional<τ_0_0>
|
||||
// CHECK-NOT: apply
|
||||
// CHECK-LABEL: } // end sil function '$s32sil_combine_concrete_existential29testWitnessReturnOptionalSelfAA2PP_pSgyF'
|
||||
public func testWitnessReturnOptionalSelf() -> PP? {
|
||||
let p: PP = CC()
|
||||
|
||||
@@ -75,7 +75,7 @@ _ = ArchetypeToArchetypeCast(t1: c, t2: b)
|
||||
// y -> x where x is a super class of y.
|
||||
// CHECK-LABEL: sil shared {{.*}}@$s30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1DC_AA1CCTt1g5 : $@convention(thin) (@guaranteed D) -> @owned C {
|
||||
// CHECK: [[T1:%.*]] = upcast %0 : $D to $C
|
||||
// CHECK: strong_retain %0 : $D
|
||||
// CHECK: strong_retain [[T1]]
|
||||
// CHECK: return [[T1]] : $C
|
||||
// CHECK: } // end sil function '$s30specialize_checked_cast_branch011ArchetypeToE4Cast2t12t2q_x_q_tr0_lFAA1DC_AA1CCTt1g5'
|
||||
_ = ArchetypeToArchetypeCast(t1: d, t2: c)
|
||||
|
||||
@@ -11,7 +11,7 @@ extension P {
|
||||
|
||||
class C<T> : P {
|
||||
// CHECK-LABEL: sil shared [noinline] @$s23specialize_dynamic_self1CC11returnsSelfACyxGXDyFSi_Tg5 : $@convention(method) (@guaranteed C<Int>) -> @owned C<Int>
|
||||
// CHECK: [[RESULT:%.*]] = alloc_stack $C<Int>
|
||||
// CHECK: [[RESULT:%.*]] = alloc_stack {{.*}}$C<Int>
|
||||
// CHECK: [[FN:%.*]] = function_ref @$s23specialize_dynamic_self1PPAAE7method1yyF : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
|
||||
// CHECK: apply [[FN]]<@dynamic_self C<Int>>([[RESULT]]) : $@convention(method) <τ_0_0 where τ_0_0 : P> (@in_guaranteed τ_0_0) -> ()
|
||||
// CHECK: return %0 : $C<Int>
|
||||
|
||||
@@ -377,15 +377,15 @@ public func testResilientInlinablePropertyCallsResilientInlinable() {
|
||||
// RESILIENT: {{bb[0-9]+}}({{%[^,]+}} : $Int, {{%[^,]+}} : @_eagerMove $
|
||||
// RESILIENT-LABEL: } // end sil function '$s9External218ResilientContainerV33genericEagerMoveInlineableContextyyxlFSi_Tgq5'
|
||||
|
||||
// RESILIENT-LABEL: sil [serialized] [canonical] @$s9External218ResilientContainerV33genericEagerMoveInlineableContextyyxlF : {{.*}} {
|
||||
// RESILIENT-LABEL: sil [serialized] [canonical] [ossa] @$s9External218ResilientContainerV33genericEagerMoveInlineableContextyyxlF : {{.*}} {
|
||||
// RESILIENT: {{bb[0-9]+}}({{%[^,]+}} : $*T, {{%[^,]+}} : @_eagerMove $
|
||||
// RESILIENT-LABEL: } // end sil function '$s9External218ResilientContainerV33genericEagerMoveInlineableContextyyxlF'
|
||||
|
||||
// RESILIENT-LABEL: sil [serialized] [canonical] @$s9External218ResilientContainerV26eagerMoveInlineableContextyyF : $@convention(method) (@in_guaranteed ResilientContainer) -> () {
|
||||
// RESILIENT-LABEL: sil [serialized] [canonical] [ossa] @$s9External218ResilientContainerV26eagerMoveInlineableContextyyF : $@convention(method) (@in_guaranteed ResilientContainer) -> () {
|
||||
// RESILIENT: {{bb[0-9]+}}({{%[^,]+}} : @_eagerMove $
|
||||
// RESILIENT-LABEL: } // end sil function '$s9External218ResilientContainerV26eagerMoveInlineableContextyyF'
|
||||
|
||||
// RESILIENT-LABEL: sil [serialized] [canonical] @$s9External218ResilientContainerV17inlineableContextyyF
|
||||
// RESILIENT-LABEL: sil [serialized] [canonical] [ossa] @$s9External218ResilientContainerV17inlineableContextyyF
|
||||
// RESILIENT: [[RES:%.*]] = alloc_stack [var_decl] $@_opaqueReturnTypeOf("$s9External218ResilientContainerV16computedPropertyQrvp", 0)
|
||||
// RESILIENT: [[FUN:%.*]] = function_ref @$s9External218ResilientContainerV16computedPropertyQrvg
|
||||
// RESILIENT: apply [[FUN]]([[RES]], %0)
|
||||
|
||||
@@ -141,7 +141,7 @@ ArchetypeToConcreteConvertUInt8(t: f)
|
||||
// CHECK-LABEL: sil shared [noinline] {{.*}}@$s37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC{{[_0-9a-zA-Z]*}}FAA1DC_Tg5 : $@convention(thin) (@guaranteed D) -> @owned C {
|
||||
// CHECK: bb0([[ARG:%.*]] : $D):
|
||||
// CHECK: [[UPCAST:%.*]] = upcast [[ARG]] : $D to $C
|
||||
// CHECK: strong_retain [[ARG]]
|
||||
// CHECK: strong_retain [[UPCAST]]
|
||||
// CHECK: return [[UPCAST]]
|
||||
// CHECK: } // end sil function '$s37specialize_unconditional_checked_cast27ArchetypeToConcreteConvertC{{[_0-9a-zA-Z]*}}FAA1DC_Tg5'
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@ import def_debug
|
||||
|
||||
// CHECK: sil_scope [[SCOPE_ONE:[0-9]+]] { loc "{{.*}}def_debug.swift":2:13 parent @$s9def_debug3foo1xs6UInt64VAE_tF : $@convention(thin) (UInt64) -> UInt64 inlined_at [[INLINE_SITE_ONE:[0-9]+]] }
|
||||
// CHECK: sil_scope [[SCOPE_TWO:[0-9]+]] { loc "{{.*}}def_debug.swift":3:5 parent [[SCOPE_ONE]] inlined_at [[INLINE_SITE_ONE]] }
|
||||
// CHECK: sil_scope {{[0-9]+}} { loc "{{.*}}def_debug.swift":3:18 parent [[SCOPE_TWO]] inlined_at [[INLINE_SITE_ONE]] }
|
||||
let simpleFunc = foo(x: 1)
|
||||
|
||||
// _transparent with Onone
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// RUN: %empty-directory(%t)
|
||||
// RUN: %target-build-swift -swift-version 4 -O -Xllvm -sil-disable-pass=compute-side-effects -Xllvm -sil-disable-pass=cmo -whole-module-optimization -emit-module-path %t/LibCore.swiftmodule %S/Inputs/xref-private-type/LibCore.swift
|
||||
// RUN: %target-build-swift -swift-version 4 -O -Xllvm -sil-disable-pass=compute-side-effects -Xllvm -sil-disable-pass=cmo -I %t -whole-module-optimization -emit-module-path %t/Lib.swiftmodule %S/Inputs/xref-private-type/Lib.swift
|
||||
// RUN: %target-build-swift -swift-version 4 -O -I %t -Xllvm -sil-print-types -emit-sil %s | %FileCheck %s
|
||||
// RUN: %target-build-swift -swift-version 4 -O -Xllvm -sil-disable-pass=copy-to-borrow-optimization -I %t -Xllvm -sil-print-types -emit-sil %s | %FileCheck %s
|
||||
|
||||
import Lib
|
||||
|
||||
|
||||
Reference in New Issue
Block a user