Files
TheRock/compiler/amd-llvm/lld/test/MachO/cstring-dedup.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

107 lines
3.0 KiB
ArmAsm

# REQUIRES: x86
# RUN: rm -rf %t; split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/test.s -o %t/test.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-darwin %t/more-foo.s -o %t/more-foo.o
# RUN: %lld -dylib %t/test.o %t/more-foo.o -o %t/test
# RUN: llvm-objdump --macho --section="__TEXT,__cstring" %t/test | \
# RUN: FileCheck %s --check-prefix=STR --implicit-check-not foo --implicit-check-not bar
# RUN: llvm-objdump --macho --section="__DATA,ptrs" --syms %t/test | FileCheck %s
# RUN: llvm-readobj --section-headers %t/test | FileCheck %s --check-prefix=HEADER
## Make sure we only have 3 deduplicated strings in __cstring.
# STR: Contents of (__TEXT,__cstring) section
# STR: {{[[:xdigit:]]+}} foo
# STR: {{[[:xdigit:]]+}} barbaz
# STR: {{[[:xdigit:]]+}} {{$}}
## Make sure both symbol and section relocations point to the right thing.
# CHECK: Contents of (__DATA,ptrs) section
# CHECK-NEXT: __TEXT:__cstring:foo
# CHECK-NEXT: __TEXT:__cstring:foo
# CHECK-NEXT: __TEXT:__cstring:foo
# CHECK-NEXT: __TEXT:__cstring:foo
# CHECK-NEXT: __TEXT:__cstring:foo
# CHECK-NEXT: __TEXT:__cstring:foo
# CHECK-NEXT: __TEXT:__cstring:barbaz
# CHECK-NEXT: __TEXT:__cstring:baz
# CHECK-NEXT: __TEXT:__cstring:barbaz
# CHECK-NEXT: __TEXT:__cstring:baz
# CHECK-NEXT: __TEXT:__cstring:{{$}}
# CHECK-NEXT: __TEXT:__cstring:{{$}}
## Make sure the symbol addresses are correct too.
# CHECK: SYMBOL TABLE:
# CHECK-DAG: [[#%.16x,FOO:]] l O __TEXT,__cstring _local_foo1
# CHECK-DAG: [[#FOO]] l O __TEXT,__cstring _local_foo2
# CHECK-DAG: [[#FOO]] g O __TEXT,__cstring _globl_foo1
# CHECK-DAG: [[#FOO]] g O __TEXT,__cstring _globl_foo2
# CHECK-DAG: [[#%.16x,BAR:]] l O __TEXT,__cstring _bar1
# CHECK-DAG: [[#BAR]] l O __TEXT,__cstring _bar2
# CHECK-DAG: [[#%.16x,ZERO:]] l O __TEXT,__cstring _zero1
# CHECK-DAG: [[#ZERO]] l O __TEXT,__cstring _zero2
## Make sure we set the right alignment and flags.
# HEADER: Name: __cstring
# HEADER-NEXT: Segment: __TEXT
# HEADER-NEXT: Address:
# HEADER-NEXT: Size:
# HEADER-NEXT: Offset:
# HEADER-NEXT: Alignment: 4
# HEADER-NEXT: RelocationOffset:
# HEADER-NEXT: RelocationCount: 0
# HEADER-NEXT: Type: CStringLiterals
# HEADER-NEXT: Attributes [ (0x0)
# HEADER-NEXT: ]
# HEADER-NEXT: Reserved1: 0x0
# HEADER-NEXT: Reserved2: 0x0
# HEADER-NEXT: Reserved3: 0x0
#--- test.s
.cstring
.p2align 2
_local_foo1:
.asciz "foo"
_local_foo2:
.asciz "foo"
L_.foo1:
.asciz "foo"
L_.foo2:
.asciz "foo"
_bar1:
.ascii "bar"
_baz1:
.asciz "baz"
_bar2:
.ascii "bar"
_baz2:
.asciz "baz"
_zero1:
.asciz ""
_zero2:
.asciz ""
.section __DATA,ptrs,literal_pointers
.quad L_.foo1
.quad L_.foo2
.quad _local_foo1
.quad _local_foo2
.quad _globl_foo1
.quad _globl_foo2
.quad _bar1
.quad _baz1
.quad _bar2
.quad _baz2
.quad _zero1
.quad _zero2
#--- more-foo.s
.globl _globl_foo1, _globl_foo2
.cstring
.p2align 4
_globl_foo1:
.asciz "foo"
_globl_foo2:
.asciz "foo"