68 lines · plain
1## This test checks updating a dynamic shared library ID in a MachO binary.2 3# RUN: yaml2obj %s --docnum=1 -o %t4 5## Specifying -id once:6# RUN: llvm-install-name-tool -id /usr/lib/A_long_long_test %t7# RUN: llvm-objdump -p %t | FileCheck %s --check-prefix=ID --implicit-check-not='name /usr'8 9# ID: name /usr/lib/A_long_long_test10 11## Specifying -id more than once:12# RUN: llvm-install-name-tool -id /usr/lib/B_long -id /usr/lib/K_long -id /usr/A_short %t13# RUN: llvm-objdump -p %t | FileCheck %s --check-prefix=ID-MULTIPLE --implicit-check-not='name /usr'14 15# ID-MULTIPLE: name /usr/A_short16 17## Specifying -id with empty string:18# RUN: not llvm-install-name-tool -id '' %t 2>&1 | \19# RUN: FileCheck %s --check-prefix=EMPTY20 21# EMPTY: cannot specify an empty id22 23## Missing id argument:24# RUN: not llvm-install-name-tool %t -id 2>&1 | \25# RUN: FileCheck %s --check-prefix=MISSING26 27# MISSING: missing argument to -id option28 29## Shared dylib binary30--- !mach-o31FileHeader:32 magic: 0xFEEDFACF33 cputype: 0x0100000734 cpusubtype: 0x0000000335 filetype: 0x0000000636 ncmds: 137 sizeofcmds: 5638 flags: 0x0000200039 reserved: 0x0000000040LoadCommands:41 - cmd: LC_ID_DYLIB42 cmdsize: 5643 dylib:44 name: 2445 timestamp: 246 current_version: 8211507347 compatibility_version: 6553648 Content: '/usr/lib/A'49 50# RUN: yaml2obj %s --docnum=2 -o %t51 52## Check that -id option has no effect if binary is not a shared dylib:53# RUN: cp %t %t154# RUN: llvm-install-name-tool -id /usr/lib/J %t55# RUN: cmp %t %t156 57## Executable binary58--- !mach-o59FileHeader:60 magic: 0xFEEDFACF61 cputype: 0x0100000762 cpusubtype: 0x0000000363 filetype: 0x0000000164 ncmds: 065 sizeofcmds: 066 flags: 0x0000200067 reserved: 0x0000000068