Alexander Shaposhnikov | c54959c | 2019-11-19 23:30:52 -0800 | [diff] [blame^] | 1 | ## This test checks adding a new LC_RPATH load command to a MachO binary. |
| 2 | |
| 3 | # RUN: yaml2obj %p/Inputs/i386.yaml > %t.i386 |
| 4 | # RUN: llvm-install-name-tool -add_rpath @executable_path/. %t.i386 |
| 5 | # RUN: llvm-objdump -p %t.i386 | FileCheck --check-prefix=NEW-RPATH %s |
| 6 | |
| 7 | # RUN: yaml2obj %p/Inputs/x86_64.yaml > %t.x86_64 |
| 8 | # RUN: llvm-install-name-tool -add_rpath @executable_path/. %t.x86_64 |
| 9 | # RUN: llvm-objdump -p %t.x86_64 | FileCheck --check-prefix=NEW-RPATH %s |
| 10 | |
| 11 | # NEW-RPATH: cmd LC_RPATH |
| 12 | # NEW-RPATH-NEXT: cmdsize |
| 13 | # NEW-RPATH-NEXT: @executable_path/. |
| 14 | |
| 15 | # RUN: not llvm-install-name-tool -add_rpath @executable_path/. %t.i386 2>&1 \ |
| 16 | # RUN: | FileCheck --check-prefix=DUPLICATE-RPATH %s |
| 17 | |
| 18 | # DUPLICATE-RPATH: duplicate load command |
| 19 | |
| 20 | # RUN: not llvm-install-name-tool -add_rpath @executable_path/. 2>&1 \ |
| 21 | # RUN: | FileCheck --check-prefix=NO-INPUT %s |
| 22 | |
| 23 | # NO-INPUT: no input file specified |