Skip to content

Commit 2123405

Browse files
authored
Merge pull request swiftlang#21055 from atrick/fix-devirt-test
2 parents ae0a9c1 + 861a571 commit 2123405

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/SILOptimizer/devirt_specialized_conformance.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,14 @@ extension ContiguousArray : ContiguousBytes {}
5757
func takesPointer(_ p: UnsafeRawBufferPointer) {}
5858

5959
// In specialized testWithUnsafeBytes<A>(_:), the conditional case and call to withUnsafeBytes must be eliminated.
60+
// Normally, we expect Array.withUnsafeBytes to be inlined so we would see:
61+
// [[TAKES_PTR:%.*]] = function_ref @$s30devirt_specialized_conformance12takesPointeryySWF : $@convention(thin) (UnsafeRawBufferPointer) -> ()
62+
// apply [[TAKES_PTR]](%{{.*}}) : $@convention(thin) (UnsafeRawBufferPointer) -> ()
63+
// But the inlining isn't consistent across builds with and without debug info.
64+
//
6065
// CHECK-LABEL: sil shared [noinline] @$s30devirt_specialized_conformance19testWithUnsafeBytesyyxlFSayypG_Tg5 : $@convention(thin) (@guaranteed Array<Any>) -> () {
6166
// CHECK: bb0
6267
// CHECK-NOT: witness_method
63-
// CHECK: [[TAKES_PTR:%.*]] = function_ref @$s30devirt_specialized_conformance12takesPointeryySWF : $@convention(thin) (UnsafeRawBufferPointer) -> ()
64-
// CHECK: apply [[TAKES_PTR]](%{{.*}}) : $@convention(thin) (UnsafeRawBufferPointer) -> ()
6568
// CHECK-LABEL: } // end sil function '$s30devirt_specialized_conformance19testWithUnsafeBytesyyxlFSayypG_Tg5'
6669
@inline(never)
6770
func testWithUnsafeBytes<T>(_ t: T) {

0 commit comments

Comments
 (0)