3 # RUN: rm -rf %t; split-file --no-leading-lines %s %t
5 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/foo.s -o %t/foo.o
7 ## Case 1: special symbol $ld$install_name affects the install name
8 ## since the specified version 11.0.0 matches the target version 11.0.0
10 # RUN: %lld -o %t/libfoo1.dylib %t/libLDInstallName.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.0
11 # RUN: llvm-otool -L %t/libfoo1.dylib | FileCheck --check-prefix=CASE1 %s
12 # CASE1: /New (compatibility version 1.1.1, current version 5.0.0)
14 ## Case 2: special symbol $ld$install_name does not affect the install name
15 ## since the specified version 11.0.0 does not match the target version 12.0.0
17 # RUN: %lld -o %t/libfoo2.dylib %t/libLDInstallName.tbd %t/foo.o -dylib -platform_version macos 12.0.0 12.0.0
18 # RUN: llvm-otool -L %t/libfoo2.dylib | FileCheck --check-prefix=CASE2 %s
19 # CASE2: /Old (compatibility version 1.1.1, current version 5.0.0)
21 ## Check that we emit a warning for an invalid os version.
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 %s
26 # INVALID-VERSION: libLDInstallNameInvalid.tbd(/Old): failed to parse os version, symbol '$ld$install_name$os11.a$/New' ignored
28 ## Case 3: If there's another library that has '/New' as its original
29 ## install_name, we should take current-version and compatibility-version from
30 ## the first library we load with that install name. For a reexport,
31 ## the first loaded library is the library doing the reexport, not the
32 ## reexported library.
33 # RUN: %lld -o %t/libfoo3.dylib %t/libLDInstallNameNew.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.0
34 # RUN: llvm-otool -L %t/libfoo3.dylib | FileCheck --check-prefix=CASE3 %s
35 # RUN: %lld -o %t/libfoo3.dylib %t/libLDInstallName.tbd %t/libLDInstallNameNew.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.0
36 # RUN: llvm-otool -L %t/libfoo3.dylib | FileCheck --check-prefix=CASE1 %s
37 # RUN: %lld -o %t/libfoo3.dylib %t/libLDInstallNameNew.tbd %t/libLDInstallName.tbd %t/foo.o -dylib -platform_version macos 11.0.0 11.0.0
38 # RUN: llvm-otool -L %t/libfoo3.dylib | FileCheck --check-prefix=CASE3 %s
39 # CASE3: /New (compatibility version 4.5.6, current version 9.0.0)
44 #--- libLDInstallName.tbd
47 uuids
: [ 'x86_64: 19311012-01AB-342E-812B-73A74271A715' ]
51 compatibility-version
: 1.1.1
54 symbols
: [ '$ld$install_name$os11.0$/New', _xxx
]
57 #--- libLDInstallNameInvalid.tbd
60 uuids
: [ 'x86_64: 19311011-01AB-342E-112B-73A74271A715' ]
64 compatibility-version
: 1.1.1
67 symbols
: [ '$ld$install_name$os11.a$/New', _xxx
]
70 #--- libLDInstallNameNew.tbd
73 targets
: [ x86_64-macos
]
75 - target
: x86_64-macos
76 value
: 2E994C7F-
3F03-
3A07-
879C-
55690D22BEDA
79 compatibility-version
: 4.5.6
81 - targets
: [ x86_64-macos
]
82 libraries
: [ '@loader_path/libLDInstallName' ]