Files
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

99 lines
5.4 KiB
Plaintext

;; Test --prefix option.
;; Separators change from platform to platform. In POSIX the full path for the
;; directory './Inputs' appended with the file 'source-interleave-x86_64.c' is
;; './Inputs/source-interleave-x86_64.c'. For Windows it is
;; './Inputs\source-interleave-x86_64.c'. Platform specific tests are needed
;; since '\' may or may not be a separator.
;; Test prefix option ignored for relative paths.
;; For the test below it is possible to accept both '/' and '\' as a separator.
; RUN: sed -e "s,SRC_COMPDIR,./Inputs,g" %p/Inputs/source-interleave.ll > %t-relative-path.ll
; RUN: llc -o %t-relative-path.o -filetype=obj -mtriple=x86_64-pc-linux %t-relative-path.ll
; RUN: llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-relative-path.o -DPREFIX=. -DCOMPDIR=/Inputs
; CHECK-BROKEN-PREFIX: warning: '[[FILE]]': failed to find source [[PREFIX]][[COMPDIR]]{{[/\\]}}source-interleave-x86_64.c
;; Test invalid source interleave fixed by adding the correct prefix.
; RUN: sed -e "s,SRC_COMPDIR,/Inputs,g" %p/Inputs/source-interleave.ll > %t-missing-prefix.ll
; RUN: llc -o %t-missing-prefix.o -filetype=obj -mtriple=x86_64-pc-linux %t-missing-prefix.ll
; RUN: llvm-objdump --prefix %p --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX
; CHECK-MISSING-PREFIX-FIX: ; int foo() {
;; Test valid source interleave broken by adding an incorrect prefix.
; RUN: sed -e "s,SRC_COMPDIR,%/p/Inputs,g" %p/Inputs/source-interleave.ll > %t-correct-prefix.ll
; RUN: llc -o %t-correct-prefix.o -filetype=obj -mtriple=x86_64-pc-linux %t-correct-prefix.ll
; RUN: llvm-objdump --prefix myprefix --source %t-correct-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-correct-prefix.o -DPREFIX=myprefix%/p -DCOMPDIR=/Inputs
;; Using only a prefix separator is the same as not using the `--prefix` option.
; RUN: llvm-objdump --prefix / --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-missing-prefix.o -DPREFIX='' -DCOMPDIR=/Inputs
;; All trailing separators on the prefix are discarded.
;; The prefix 'myprefix//' is converted to 'myprefix'.
; RUN: llvm-objdump --prefix myprefix// --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-missing-prefix.o -DPREFIX=myprefix -DCOMPDIR=/Inputs
;; Test invalid source interleave fixed by adding the correct prefix and
;; stripping out an extra directory from the path.
; RUN: sed -e "s,SRC_COMPDIR,/extra/Inputs,g" %p/Inputs/source-interleave.ll > %t-extra-path-prefix.ll
; RUN: llc -o %t-extra-path-prefix.o -filetype=obj -mtriple=x86_64-pc-linux %t-extra-path-prefix.ll
; RUN: llvm-objdump --prefix %p --prefix-strip 1 --source %t-extra-path-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX
;; Test do not skip extra separators. The --prefix-strip should take into
;; account each separator individually. Hence, to fix '/extra/Inputs'
;; --prefix-strip needs to be 1. To fix '//extra/Inputs' --prefix-strip
;; needs to be 2.
; RUN: sed -e "s,SRC_COMPDIR,//extra/Inputs,g" %p/Inputs/source-interleave.ll > %t-extra-sep-path-prefix.ll
; RUN: llc -o %t-extra-sep-path-prefix.o -filetype=obj -mtriple=x86_64-pc-linux %t-extra-sep-path-prefix.ll
; RUN: llvm-objdump --prefix %p --prefix-strip 2 --source %t-extra-sep-path-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX
;; Test --prefix-strip value of 0. No effect.
;; SRC_COMPDIR is set to '/Inputs' before and after --prefix-strip 0.
; RUN: llvm-objdump --prefix %p --prefix-strip 0 --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX
;; Test --prefix-strip value equal to the number of directory components.
;; SRC_COMPDIR is set to '/Inputs' before --prefix-strip 1.
;; SRC_COMPDIR becomes '' after --prefix-strip 1.
; RUN: llvm-objdump --prefix %p/Inputs --prefix-strip 1 --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX
;; Test --prefix-strip value greater than the number of components.
;; SRC_COMPDIR is set to '/Inputs' before --prefix-strip 2.
;; SRC_COMPDIR becomes '' after --prefix-strip 2.
; RUN: llvm-objdump --prefix %p/Inputs --prefix-strip 2 --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX
;; Test negative value --prefix-strip. Reports an error.
; RUN: not llvm-objdump --prefix %p --prefix-strip '-1' --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-INVALID-PREFIX-STRIP -DOPTION='-1'
; CHECK-INVALID-PREFIX-STRIP: {{.*}}llvm-objdump{{.*}}: error: --prefix-strip: expected a non-negative integer, but got '[[OPTION]]'
;; Test text value --prefix-strip. Reports an error.
; RUN: not llvm-objdump --prefix %p --prefix-strip foo --source %t-missing-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-INVALID-PREFIX-STRIP -DOPTION='foo'
;; Test use of --prefix= and --prefix-strip=
; RUN: sed -e "s,SRC_COMPDIR,/extra/Inputs,g" %p/Inputs/source-interleave.ll > %t-extra-path-prefix.ll
; RUN: llc -o %t-extra-path-prefix.o -filetype=obj -mtriple=x86_64-pc-linux %t-extra-path-prefix.ll
; RUN: llvm-objdump --prefix=%p --prefix-strip=1 --source %t-extra-path-prefix.o 2>&1 | \
; RUN: FileCheck %s --check-prefix=CHECK-MISSING-PREFIX-FIX