Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-objcopy/MachO/install-name-tool-change.test
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

108 lines
4.1 KiB
Plaintext

## This test checks updating a dependent shared library install name in a MachO binary.
# RUN: yaml2obj %s -o %t
## Specifying -change once:
# RUN: cp %t %t.copy
# RUN: llvm-install-name-tool -change /usr/dylib/LOAD /usr/long/long/dylib/LOAD %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE --implicit-check-not='name /usr'
# CHANGE: name /usr/long/long/dylib/LOAD
# CHANGE: name /usr/dylib/WEAK
## Specifying -change multiple times:
# RUN: cp %t %t.copy
# RUN: llvm-install-name-tool -change /usr/dylib/WEAK /usr/sh/WEAK \
# RUN: -change /usr/dylib/LOAD /usr/sh/LOAD %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE-MULTIPLE --implicit-check-not='name /usr'
# CHANGE-MULTIPLE: name /usr/sh/LOAD
# CHANGE-MULTIPLE: name /usr/sh/WEAK
## Changing same dependent library name multiple times:
# RUN: cp %t %t.copy
# RUN: llvm-install-name-tool -change /usr/dylib/LOAD /usr/LOAD \
# RUN: -change /usr/dylib/LOAD /usr/XXXX %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE-REPEAT --implicit-check-not='name /usr'
# CHANGE-REPEAT: name /usr/LOAD
# CHANGE-REPEAT: name /usr/dylib/WEAK
## Specifying dependent library names in a chain:
# RUN: cp %t %t.copy
# RUN: llvm-install-name-tool -change /usr/dylib/LOAD /usr/XX/LOAD \
# RUN: -change /usr/XX/LOAD /usr/YY/LOAD %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE-CHAIN --implicit-check-not='name /usr'
# CHANGE-CHAIN: name /usr/XX/LOAD
# CHANGE-CHAIN: name /usr/dylib/WEAK
## Changing multiple dependent library names where one exists and the other doesn't:
# RUN: cp %t %t.copy
# RUN: llvm-install-name-tool -change /usr/dylib/LOAD /usr/JOJO/LOAD \
# RUN: -change /usr/BIZARRE /usr/KOKO/LOAD %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE-SWITCH --implicit-check-not='name /usr'
# CHANGE-SWITCH: name /usr/JOJO/LOAD
# CHANGE-SWITCH: name /usr/dylib/WEAK
## Changing to a common dependent library name:
# RUN: cp %t %t.copy
# RUN: llvm-install-name-tool -change /usr/dylib/LOAD /usr/COMMON \
# RUN: -change /usr/dylib/WEAK /usr/COMMON %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE-COMMON --implicit-check-not='name /usr'
# CHANGE-COMMON: name /usr/COMMON
# CHANGE-COMMON: name /usr/COMMON
## Change all common dependent library names at once:
# RUN: llvm-install-name-tool -change /usr/COMMON /usr/ONCE %t.copy
# RUN: llvm-objdump -p %t.copy | FileCheck %s --check-prefix=CHANGE-ONCE --implicit-check-not='name /usr'
# CHANGE-ONCE: name /usr/ONCE
# CHANGE-ONCE: name /usr/ONCE
## Check that -change option has no effect if the binary doesn't contain old install name:
# RUN: cp %t %t1
# RUN: llvm-install-name-tool -change /usr/JOJO/LOAD /usr/XX/LOAD \
# RUN: -change /usr/KOKO/WEAK /usr/YY/WEAK %t
# RUN: cmp %t %t1
## Missing a -change argument:
# RUN: not llvm-install-name-tool %t -change /usr/ONCE 2>&1 | \
# RUN: FileCheck %s --check-prefix=MISSING
## Missing both -change arguments:
# RUN: not llvm-install-name-tool %t -change 2>&1 | \
# RUN: FileCheck %s --check-prefix=MISSING
# MISSING: missing argument to -change option
--- !mach-o
FileHeader:
magic: 0xFEEDFACF
cputype: 0x01000007
cpusubtype: 0x00000003
filetype: 0x00000001
ncmds: 2
sizeofcmds: 80
flags: 0x00002000
reserved: 0x00000000
LoadCommands:
- cmd: LC_LOAD_DYLIB
cmdsize: 40
dylib:
name: 24
timestamp: 2
current_version: 82115073
compatibility_version: 65536
Content: '/usr/dylib/LOAD'
- cmd: LC_LOAD_WEAK_DYLIB
cmdsize: 40
dylib:
name: 24
timestamp: 2
current_version: 82115073
compatibility_version: 65536
Content: '/usr/dylib/WEAK'