Files
TheRock/compiler/amd-llvm/clang/test/OffloadTools/clang-sycl-linker/triple.ll
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

71 lines
2.7 KiB
LLVM

; Tests the clang-sycl-linker tool: triple handling.
;
; REQUIRES: spirv-registered-target
;
; RUN: rm -rf %t && split-file %s %t
;
; Test when explicit -triple= is used. Input does not supply a triple.
; RUN: llvm-as %t/no-triple.ll -o %t/no-triple.bc
; RUN: clang-sycl-linker --dry-run -v -triple=spirv64 %t/no-triple.bc -o %t/no-triple-input.out 2>&1 \
; RUN: | FileCheck %s --check-prefix=NO-TRIPLE-INPUT
; NO-TRIPLE-INPUT: sycl-bundle: image kind: spv, triple: spirv64, arch: {{$}}
;
; Test that triple was inferred from inputs and recorded in the offload image.
; RUN: llvm-as %t/input1.ll -o %t/input1.bc
; RUN: llvm-as %t/input2.ll -o %t/input2.bc
; RUN: clang-sycl-linker --dry-run -v --module-split-mode=none %t/input1.bc %t/input2.bc -o %t/spirv.out 2>&1 \
; RUN: | FileCheck %s --check-prefix=TRIPLE-INFERENCE
; TRIPLE-INFERENCE: sycl-bundle: image kind: spv, triple: spirv64, arch: {{$}}
;
; Test error on mismatched triple between inputs.
; RUN: llvm-as %t/input-mismatch.ll -o %t/input-mismatch.bc
; RUN: not clang-sycl-linker --dry-run %t/input1.bc %t/input-mismatch.bc -o %t/mismatch.out 2>&1 \
; RUN: | FileCheck %s --check-prefix=TRIPLE-MISMATCH
; TRIPLE-MISMATCH: error: conflicting target triples: 'spirv64' (from {{.*}}input1.bc) vs 'spirv32' (from {{.*}}input-mismatch.bc)
;
; Test error when explicit -triple= conflicts with the input's triple.
; RUN: not clang-sycl-linker --dry-run -triple=spirv32 %t/input1.bc -o %t/explicit.out 2>&1 \
; RUN: | FileCheck %s --check-prefix=EXPL-TRIPLE-MISMATCH
; EXPL-TRIPLE-MISMATCH: error: conflicting target triples: 'spirv32' (from --triple=) vs 'spirv64' (from {{.*}}input1.bc)
;
; Test error when neither -triple= nor any input supplies a triple.
; RUN: not clang-sycl-linker --dry-run %t/no-triple.bc -o a.out 2>&1 \
; RUN: | FileCheck %s --check-prefix=NO-TRIPLE
; NO-TRIPLE: Target triple must be specified or inferable from inputs
;--- input1.ll
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
target triple = "spirv64"
define spir_kernel void @kernel_a() #0 {
ret void
}
attributes #0 = { "sycl-module-id"="TU1.cpp" }
;--- input2.ll
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1"
target triple = "spirv64"
define spir_kernel void @kernel_b() #0 {
ret void
}
attributes #0 = { "sycl-module-id"="TU2.cpp" }
;--- input-mismatch.ll
target triple = "spirv32"
define spir_kernel void @kernel_c() #0 {
ret void
}
attributes #0 = { "sycl-module-id"="TU3.cpp" }
;--- no-triple.ll
define spir_kernel void @kernel_d() #0 {
ret void
}
attributes #0 = { "sycl-module-id"="TU4.cpp" }