Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-readobj/ELF/string-dump.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

60 lines
2.4 KiB
Plaintext

# Check the dumping of a section as strings.
# RUN: yaml2obj %s -o %t
# RUN: llvm-readobj --string-dump=.strings \
# RUN: --string-dump=.not_null_terminated %t > %t.readobj.out
# RUN: FileCheck %s --input-file=%t.readobj.out --check-prefixes=HEADER,CHECK
# Also test the different ways --string-dump can be specified, i.e. as a short
# flag (-p), with different prefix modes (-p .foo, -p=.foo, -p.foo), and with
# the value being a index section number instead of a section name.
# RUN: llvm-readobj -p.strings -p.strings -p.not_null_terminated %t | cmp %t.readobj.out -
# RUN: llvm-readobj --string-dump=1 --string-dump=2 %t | cmp %t.readobj.out -
# RUN: llvm-readobj -p1 -p1 -p2 %t | cmp %t.readobj.out -
# Run readelf flag tests with an additional flag, --file-header, so we can test
# -p grouped with something.
# RUN: llvm-readelf --file-header --string-dump=.strings \
# RUN: --string-dump=.not_null_terminated %t > %t.readelf.out
# RUN: FileCheck %s --input-file=%t.readelf.out
# RUN: llvm-readelf -h -p .strings -p .not_null_terminated %t | cmp %t.readelf.out -
# RUN: llvm-readelf -p.strings -hp.not_null_terminated %t | cmp %t.readelf.out -
# RUN: llvm-readelf -hp1 -p2 %t | cmp %t.readelf.out -
# RUN: llvm-readelf -hp 1 -p.not_null_terminated %t | cmp %t.readelf.out -
# HEADER: LoadName:
# CHECK: {{^$}}
# CHECK-NEXT: String dump of section '.strings':
# CHECK-NEXT: [ 0] here
# CHECK-NEXT: [ 5] are
# CHECK-NEXT: [ 9] some
# CHECK-NEXT: [ e] strings
# CHECK-EMPTY:
# CHECK-NEXT: String dump of section '.not_null_terminated':
# CHECK-NEXT: [ 0] no
# CHECK-NEXT: [ 3] null{{$}}
# CHECK-NOT: {{.}}
# RUN: llvm-readobj --string-dump=does_not_exist %t 2>&1 | FileCheck -DFILE=%t %s --check-prefix=WARN1
# RUN: llvm-readobj --string-dump=42 %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=WARN2
# RUN: llvm-readelf --string-dump=does_not_exist %t 2>&1 | FileCheck -DFILE=%t %s --check-prefix=WARN1
# RUN: llvm-readelf --string-dump=42 %t 2>&1 | FileCheck %s -DFILE=%t --check-prefix=WARN2
# WARN1: warning: '[[FILE]]': could not find section 'does_not_exist'
# WARN2: warning: '[[FILE]]': could not find section 42
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Sections:
- Name: .strings
Type: SHT_PROGBITS
Content: 686572650061726500736f6d6500737472696e677300
- Name: .not_null_terminated
Type: SHT_PROGBITS
Content: 6e6f006e756c6c