Files
TheRock/compiler/amd-llvm/lld/test/ELF/relocatable-discard-locals.s
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

66 lines
2.5 KiB
ArmAsm

# REQUIRES: x86
## Test that -r keeps local symbols which are used in relocations even when
## --discard-{locals,all} is given.
# RUN: llvm-mc -filetype=obj -triple=x86_64 -save-temp-labels %s -o %t.o
# RUN: ld.lld -r --discard-locals %t.o -o %tlocal.ro
# RUN: llvm-readelf -s %tlocal.ro | FileCheck --check-prefix=DISCARD-LOCALS %s
# RUN: llvm-readobj -r %tlocal.ro | FileCheck --check-prefix=REL %s
# RUN: ld.lld -r --discard-all %t.o -o %tall.ro
# RUN: llvm-readelf -s %tall.ro | FileCheck --check-prefix=DISCARD-ALL %s
# RUN: llvm-readobj -r %tall.ro | FileCheck --check-prefix=REL %s
## --discard-locals removes unused local symbols which start with ".L"
# DISCARD-LOCALS: 0: {{0+}} 0 NOTYPE LOCAL DEFAULT UND
# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} .Lused
# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} used
# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} .L.str
# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} unused
# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} unused_gc
# DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} .text
# DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} text
# DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} gc
# DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} .rodata.str1.1
# DISCARD-LOCALS-NEXT: NOTYPE GLOBAL DEFAULT {{.*}} _start
## --discard-all removes all unused regular local symbols.
# DISCARD-ALL: 0: {{0+}} 0 NOTYPE LOCAL DEFAULT UND
# DISCARD-ALL-NEXT: NOTYPE LOCAL DEFAULT {{.*}} .Lused
# DISCARD-ALL-NEXT: NOTYPE LOCAL DEFAULT {{.*}} used
# DISCARD-ALL-NEXT: NOTYPE LOCAL DEFAULT {{.*}} .L.str
# DISCARD-ALL-NEXT: SECTION LOCAL DEFAULT {{.*}} .text
# DISCARD-ALL-NEXT: SECTION LOCAL DEFAULT {{.*}} text
# DISCARD-ALL-NEXT: SECTION LOCAL DEFAULT {{.*}} gc
# DISCARD-ALL-NEXT: SECTION LOCAL DEFAULT {{.*}} .rodata.str1.1
# DISCARD-ALL-NEXT: NOTYPE GLOBAL DEFAULT {{.*}} _start
# REL: .rela.text {
# REL-NEXT: R_X86_64_PLT32 text 0xFFFFFFFFFFFFFFFC
# REL-NEXT: R_X86_64_PLT32 .Lused 0xFFFFFFFFFFFFFFFC
# REL-NEXT: R_X86_64_PLT32 used 0xFFFFFFFFFFFFFFFC
# REL-NEXT: R_X86_64_PC32 .L.str 0xFFFFFFFFFFFFFFFC
# REL-NEXT: }
.globl _start
_start:
call text@plt
jmp .Lused@plt
call used@plt
leaq .L.str(%rip), %rdi
.section text,"ax"
.Lunused:
.Lused:
unused:
used:
.section gc,"ax"
.Lunused_gc:
unused_gc:
ret
.section .rodata.str1.1,"aMS",@progbits,1
.L.str: .asciz "a"