Skip to content

Commit 6ba55b4

Browse files
authored
Merge pull request #85192 from mikeash/client-retain-release-symbol-test-fixes
[Test] Fix ABI and symbol visibility tests for client retain/release.
2 parents 0d99dbd + 94e32d8 commit 6ba55b4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

test/abi/macOS/arm64/stdlib.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,3 +1143,9 @@ Removed: _$sSS10_wordIndex6beforeSS0B0VAD_tF
11431143
// Internal info exposed for swift-inspect.
11441144
Added: __swift_debug_allocationPoolSize
11451145
Added: __swift_debug_metadataAllocatorPageSize
1146+
1147+
// New symbols to support emit-into-client retain/release.
1148+
Added: __swift_retainRelease_slowpath_mask_v1
1149+
Added: _swift_release_preservemost
1150+
Added: _swift_release_preservemost_weak_placeholder
1151+
Added: _swift_retain_preservemost

test/stdlib/symbol-visibility-darwin.test-sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1-
// Ensure that we do not export any weak symbols from the dylibs.
1+
// Ensure that we do not export any unwanted weak symbols from the dylibs.
22
//
33
// Weak symbols require additional work from the loader to resolve the symbol at
44
// load time and can cause ODR violations as well as unexpected symbol
55
// satisfaction because the weak symbol may be used from a separate module.
6+
//
7+
// The _swift_release_preservemost_weak_placeholder symbol is present to allow
8+
// strong symbols from swiftCore to override weak symbols in other libraries,
9+
// to allow back-deployment usage of the swift_retain_preservemost and
10+
// swift_release_preservemost entrypoints.
611

712
// RUN: %empty-directory(%t)
813

914
// RUN: %llvm-nm --defined-only --extern-only --demangle %platform-dylib-dir/%target-library-name(swiftCore) > %t/swiftCore-all.txt
1015
// RUN: %llvm-nm --defined-only --extern-only --no-weak --demangle %platform-dylib-dir/%target-library-name(swiftCore) > %t/swiftCore-no-weak.txt
11-
// RUN: diff -u %t/swiftCore-all.txt %t/swiftCore-no-weak.txt
16+
// RUN: grep -v _swift_release_preservemost_weak_placeholder < %t/swiftCore-all.txt > %t/swiftCore-all-filtered.txt
17+
// RUN: diff -u %t/swiftCore-all-filtered.txt %t/swiftCore-no-weak.txt
1218

1319
// RUN: %llvm-nm --defined-only --extern-only --demangle %platform-dylib-dir/%target-library-name(swiftRemoteMirror) > %t/swiftRemoteMirror-all.txt
1420
// RUN: %llvm-nm --defined-only --extern-only --no-weak --demangle %platform-dylib-dir/%target-library-name(swiftRemoteMirror) > %t/swiftRemoteMirror-no-weak.txt

0 commit comments

Comments
 (0)