Skip to content

Commit 830abc3

Browse files
committed
Add test case with alwaysEmitIntoClient
1 parent fa04369 commit 830abc3

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

test/SILOptimizer/Inputs/specialize_opaque_type_archetypes_3.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ public struct ResilientContainer {
3434
return x
3535
}
3636

37+
@_alwaysEmitIntoClient
38+
@inline(never)
39+
public var inlineableProperty2 : some ExternalP2 {
40+
return x
41+
}
42+
43+
3744
@inlinable
3845
public func inlineableContext() {
3946
let x = computedProperty

test/SILOptimizer/specialize_opaque_type_archetypes.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,17 @@ public func testResilientInlinableProperty() {
337337
useP(r.inlineableProperty.myValue3())
338338
}
339339

340+
// CHECK-LABEL: sil @$s1A31testResilientInlinableProperty3yyF
341+
// CHECK: [[CONTAINER:%.*]] = alloc_stack $ResilientContainer
342+
// CHECK: [[RES:%.*]] = alloc_stack $Int64
343+
// CHECK: [[FUN:%.*]] = function_ref @$s9External218ResilientContainerV19inlineableProperty2Qrvg
344+
// CHECK: [[RES2:%.*]] = unchecked_addr_cast [[RES]] : $*Int64 to $*@_opaqueReturnTypeOf("$s9External218ResilientContainerV19inlineableProperty2Qrvp", 0)
345+
// CHECK: apply [[FUN]]([[RES2]], [[CONTAINER]])
346+
public func testResilientInlinableProperty3() {
347+
let r = ResilientContainer()
348+
useP(r.inlineableProperty2.myValue3())
349+
}
350+
340351
// CHECK-LABEL: sil @$s1A22testResilientProperty2yyF
341352
// CHECK: [[CONTAINER:%.*]] = alloc_stack $ResilientContainer2
342353
// CHECK: [[RES:%.*]] = alloc_stack $@_opaqueReturnTypeOf("$s9External319ResilientContainer2V16computedPropertyQrvp", 0)

0 commit comments

Comments
 (0)