Files
TheRock/compiler/amd-llvm/clang/test/Driver/hip-link-bundle-archive.hip
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

89 lines
5.2 KiB
Plaintext

// Check clang unbundle the archive and link them by lld.
// If there is a directory which has the same name as the
// value of the '-l' option, it should not interfere with
// the discovery and unbundling of the archive.
// RUN: rm -rf %t && mkdir %t
// RUN: touch %t/dummy.bc
// RUN: mkdir -p hipBundled
// RUN: llvm-ar cr %t/libhipBundled.a %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-L %s
// RUN: rm -rf hipBundled
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 -nogpuinc \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libhipBundled.a \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-LA %s
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU1,GNU-A %s
// RUN: llvm-ar cr %t/libhipBundled.a.5.2 %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/libhipBundled.a.5.2 \
// RUN: 2>&1 | FileCheck -check-prefixes=GNU,GNU2,GNU-A %s
// Check if a file is not an archive, it is not unbundled.
// RUN: touch %t/libNonArchive.a
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lNonArchive \
// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:libNonArchive.a \
// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t libNonArchive.a \
// RUN: 2>&1 | FileCheck -check-prefixes=NONARCHIVE %s
// Check if a file does not exist, it is not unbundled.
// RUN: not %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-unknown-linux-gnu \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/NoneExist.a \
// RUN: 2>&1 | FileCheck -check-prefixes=NONE %s
// Check unbundling archive for MSVC.
// RUN: llvm-ar cr %t/hipBundled2.lib %t/dummy.bc
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -lhipBundled2 \
// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc -L%t -l:hipBundled2.lib \
// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s
// RUN: %clang -### --offload-arch=gfx906 --offload-arch=gfx1030 \
// RUN: --no-offload-new-driver --target=x86_64-pc-windows-msvc -fuse-ld= \
// RUN: -nogpuinc -nogpulib %s -fgpu-rdc %t/hipBundled2.lib \
// RUN: 2>&1 | FileCheck -check-prefix=MSVC %s
// GNU1: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
// GNU2: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB:libhipBundled\.a\.5\.2]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"
// GNU: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}[[LIB]]" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
// GNU: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"
// GNU-L: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-lhipBundled"
// GNU-LA: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" {{.*}}"-l:libhipBundled.a"
// GNU-A: "{{.*}}ld{{.*}}" {{.*}}"-o" "a.out" "{{.*}}[[LIB]]"
// NONARCHIVE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*libNonArchive\.a}}"
// NONE-NOT: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*NoneExist\.a}}"
// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx1030" "-output=[[A1030:.*\.a]]" "-allow-missing-bundles"
// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx1030" {{.*}} "[[A1030]]"
// MSVC: "{{.*}}clang-offload-bundler" "-unbundle" "-type=a" "-input={{.*}}hipBundled2.lib" "-targets=hip-amdgcn-amd-amdhsa-unknown-gfx906" "-output=[[A906:.*\.a]]" "-allow-missing-bundles"
// MSVC: "{{.*}}lld{{.*}}" {{.*}}"-plugin-opt=mcpu=gfx906" {{.*}} "[[A906]]"
// MSVC: "{{.*}}link{{.*}}" {{.*}}"-out:a.exe" {{.*}}hipBundled2.lib"