1 ## This test checks deleting a LC_RPATH load command from a MachO binary.
3 # RUN: yaml2obj %s -o %t
5 ## Deleting a single RPath entry:
6 # RUN: llvm-install-name-tool -delete_rpath @executable_a/. %t
7 # RUN: llvm-objdump -p %t | \
8 # RUN: FileCheck %s --check-prefix=RPATHS --implicit-check-not=@executable
10 # RPATHS: @executable_b/.
11 # RPATHS: @executable_c/.
12 # RPATHS: @executable_d/.
13 # RPATHS: @executable_e/.
15 ## Deleting multiple RPath entries:
16 # RUN: llvm-install-name-tool -delete_rpath @executable_b/. \
17 # RUN: -delete_rpath @executable_c/. %t
18 # RUN: llvm-objdump -p %t | \
19 # RUN: FileCheck %s --check-prefix=RPATHS-MULTIPLE --implicit-check-not=@executable
21 # RPATHS-MULTIPLE: @executable_d/.
22 # RPATHS-MULTIPLE: @executable_e/.
24 ## Duplicate delete_rpath commands:
25 # RUN: llvm-install-name-tool -delete_rpath @executable_d/. \
26 # RUN: -delete_rpath @executable_d/. %t
27 # RUN: llvm-objdump -p %t | \
28 # RUN: FileCheck %s --check-prefix=DUPLICATE --implicit-check-not=@executable
30 # DUPLICATE: @executable_e/.
32 ## Deleting a nonexistent RPath:
33 # RUN: not llvm-install-name-tool -delete_rpath @executable_a/. %t 2>&1 | \
34 # RUN: FileCheck %s --check-prefix=ABSENT-RPATH
36 # ABSENT-RPATH: no LC_RPATH load command with path: @executable_a/.
38 ## Adding and deleting RPATH at the same time:
39 # RUN: not llvm-install-name-tool -add_rpath @executable_b/. \
40 # RUN: -delete_rpath @executable_b/. %t 2>&1 | \
41 # RUN: FileCheck %s --check-prefix=COMBINED
43 # COMBINED: cannot specify both -add_rpath '@executable_b/.' and -delete_rpath '@executable_b/.'
46 # RUN: yaml2obj %s -o %t2
47 # RUN: llvm-install-name-tool -delete_all_rpaths %t2
48 # RUN: llvm-objdump -p %t2 | FileCheck %s
52 ## Remove all RPATHS and add a new one.
53 # RUN: yaml2obj %s -o %t3
54 # RUN: llvm-install-name-tool --delete_all_rpaths -add_rpath @executable_b/. %t3
55 # RUN: llvm-objdump -p %t3 | \
56 # RUN: FileCheck %s --check-prefix=DELETE_AND_ADD --implicit-check-not=@executable
58 # DELETE_AND_ADD: @executable_b/.
64 cpusubtype: 0x00000003
74 Content: '@executable_a/.'
78 Content: '@executable_b/.'
82 Content: '@executable_c/.'
86 Content: '@executable_d/.'
90 Content: '@executable_e/.'