84 lines · plain
1# REQUIRES: x862 3# RUN: rm -rf %t; split-file --no-leading-lines %s %t4 5# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o6 7## Case 1: special symbol $ld$install_name affects the install name8## since the specified version 11.0.0 matches the target version 11.0.09 10# RUN: %lld -o %t/libfoo1.dylib %t/libLDInstallName.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.011# RUN: llvm-otool -L %t/libfoo1.dylib | FileCheck --check-prefix=CASE1 %s12# CASE1: /New (compatibility version 1.1.1, current version 5.0.0)13 14## Case 2: special symbol $ld$install_name does not affect the install name15## since the specified version 11.0.0 does not match the target version 12.0.016 17# RUN: %lld -o %t/libfoo2.dylib %t/libLDInstallName.tbd %t/foo.o -dylib -platform_version macos 12.0.0 12.0.018# RUN: llvm-otool -L %t/libfoo2.dylib | FileCheck --check-prefix=CASE2 %s19# CASE2: /Old (compatibility version 1.1.1, current version 5.0.0)20 21## Check that we emit a warning for an invalid os version.22 23# RUN: %no-fatal-warnings-lld -o %t/libfoo3.dylib %t/libLDInstallNameInvalid.tbd %t/foo.o -dylib \24# RUN: -platform_version macos 11.0.0 11.0.0 2>&1 | FileCheck --check-prefix=INVALID-VERSION %s25 26# INVALID-VERSION: libLDInstallNameInvalid.tbd(/Old): failed to parse os version, symbol '$ld$install_name$os11.a$/New' ignored27 28## Case 3: If there's another library that has '/New' as its original29## install_name, we should take current-version and compatibility-version from30## the first library we load with that install name. For a reexport,31## the first loaded library is the library doing the reexport, not the32## reexported library.33# RUN: %lld -o %t/libfoo3.dylib %t/libLDInstallNameNew.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.034# RUN: llvm-otool -L %t/libfoo3.dylib | FileCheck --check-prefix=CASE3 %s35# RUN: %lld -o %t/libfoo3.dylib %t/libLDInstallName.tbd %t/libLDInstallNameNew.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.036# RUN: llvm-otool -L %t/libfoo3.dylib | FileCheck --check-prefix=CASE1 %s37# RUN: %lld -o %t/libfoo3.dylib %t/libLDInstallNameNew.tbd %t/libLDInstallName.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.038# RUN: llvm-otool -L %t/libfoo3.dylib | FileCheck --check-prefix=CASE3 %s39# CASE3: /New (compatibility version 4.5.6, current version 9.0.0)40 41#--- foo.s42.long _xxx@GOTPCREL43 44#--- libLDInstallName.tbd45--- !tapi-tbd-v346archs: [ x86_64 ]47uuids: [ 'x86_64: 19311012-01AB-342E-812B-73A74271A715' ]48platform: macosx49install-name: '/Old'50current-version: 551compatibility-version: 1.1.152exports:53 - archs: [ x86_64 ]54 symbols: [ '$ld$install_name$os11.0$/New', _xxx ]55...56 57#--- libLDInstallNameInvalid.tbd58--- !tapi-tbd-v359archs: [ x86_64 ]60uuids: [ 'x86_64: 19311011-01AB-342E-112B-73A74271A715' ]61platform: macosx62install-name: '/Old'63current-version: 564compatibility-version: 1.1.165exports:66 - archs: [ x86_64 ]67 symbols: [ '$ld$install_name$os11.a$/New', _xxx ]68...69 70#--- libLDInstallNameNew.tbd71--- !tapi-tbd72tbd-version: 473targets: [ x86_64-macos ]74uuids:75 - target: x86_64-macos76 value: 2E994C7F-3F03-3A07-879C-55690D22BEDA77install-name: '/New'78current-version: 979compatibility-version: 4.5.680reexported-libraries:81 - targets: [ x86_64-macos ]82 libraries: [ '@loader_path/libLDInstallName' ]83...84