Files
TheRock/compiler/amd-llvm/lld/test/ELF/gc-sections-group.s
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

106 lines
3.4 KiB
ArmAsm

# REQUIRES: x86
## Check that group members are retained or discarded as a unit, and
## non-SHF_ALLOC sections in a group are subject to garbage collection,
## if at least one member has the SHF_ALLOC flag.
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o
# RUN: ld.lld --gc-sections %t.o -o %t.dead
# RUN: llvm-readobj -S %t.dead | FileCheck %s --check-prefix=CHECK-DEAD
## .mynote.ccc is retained because it is not in a group.
# CHECK-DEAD-NOT: Name: .myanote.aaa
# CHECK-DEAD-NOT: Name: .mytext.aaa
# CHECK-DEAD-NOT: Name: .mybss.aaa
# CHECK-DEAD-NOT: Name: .mynote.aaa
# CHECK-DEAD-NOT: Name: .myanote.bbb
# CHECK-DEAD-NOT: Name: .mytext.bbb
# CHECK-DEAD-NOT: Name: .mybss.bbb
# CHECK-DEAD-NOT: Name: .mynote.bbb
# CHECK-DEAD: Name: .mynote.ccc
# RUN: ld.lld --gc-sections %t.o -o %t -e anote_aaa
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-GROUP
# RUN: ld.lld --gc-sections %t.o -o %t -e aaa
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-GROUP
# RUN: ld.lld --gc-sections %t.o -o %t -e bss_aaa
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-GROUP
## note_zero as the entry point does not make much sense because it is defined
## in a non-SHF_ALLOC section. This is just to demonstrate the behavior.
# RUN: ld.lld --gc-sections %t.o -o %t -e note_aaa
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-GROUP
# CHECK-LIVE-GROUP: Name: .myanote.aaa
# CHECK-LIVE-GROUP: Name: .mytext.aaa
# CHECK-LIVE-GROUP: Name: .mybss.aaa
# CHECK-LIVE-GROUP: Name: .mynote.aaa
# CHECK-LIVE-GROUP-NOT: Name: .myanote.bbb
# CHECK-LIVE-GROUP-NOT: Name: .mytext.bbb
# CHECK-LIVE-GROUP-NOT: Name: .mybss.bbb
# CHECK-LIVE-GROUP-NOT: Name: .mynote.bbb
# CHECK-LIVE-GROUP: Name: .mynote.ccc
# RUN: ld.lld --gc-sections %t.o -o %t -e anote_bbb
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-COMDAT
# RUN: ld.lld --gc-sections %t.o -o %t -e bbb
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-COMDAT
# RUN: ld.lld --gc-sections %t.o -o %t -e bss_bbb
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-COMDAT
## note_bbb as the entry point does not make much sense because it is defined
## in a non-SHF_ALLOC section. This is just to demonstrate the behavior.
# RUN: ld.lld --gc-sections %t.o -o %t -e note_bbb
# RUN: llvm-readobj -S %t | FileCheck %s --check-prefix=CHECK-LIVE-COMDAT
# CHECK-LIVE-COMDAT-NOT: Name: .myanote.aaa
# CHECK-LIVE-COMDAT-NOT: Name: .mytext.aaa
# CHECK-LIVE-COMDAT-NOT: Name: .mybss.aaa
# CHECK-LIVE-COMDAT-NOT: Name: .mynote.aaa
# CHECK-LIVE-COMDAT: Name: .myanote.bbb
# CHECK-LIVE-COMDAT: Name: .mytext.bbb
# CHECK-LIVE-COMDAT: Name: .mybss.bbb
# CHECK-LIVE-COMDAT: Name: .mynote.bbb
# CHECK-LIVE-COMDAT: Name: .mynote.ccc
## These sections are in a zero flag group `aaa`.
.globl anote_aaa, aaa, bss_aaa, note_aaa
.section .myanote.aaa,"aG",@note,aaa
anote_aaa:
.byte 0
.section .mytext.aaa,"axG",@progbits,aaa
aaa:
.byte 0
.section .mybss.aaa,"awG",@nobits,aaa
bss_aaa:
.byte 0
.section .mynote.aaa,"G",@note,aaa
note_aaa:
.byte 0
## These sections are in a COMDAT group `bbb`.
.globl anote_bbb, bbb, bss_bbb, note_bbb
.section .myanote.bbb,"aG",@note,bbb,comdat
anote_bbb:
.byte 0
.section .mytext.bbb,"axG",@progbits,bbb,comdat
bbb:
.byte 0
.section .mybss.bbb,"awG",@nobits,bbb,comdat
bss_bbb:
.byte 0
.section .mynote.bbb,"G",@note,bbb,comdat
note_bbb:
.byte 0
## This section isn't in any group.
.section .mynote.ccc,"",@note
.byte 0