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

61 lines
2.1 KiB
C++

// RUN: %clang_cc1 %s -o - -O0 -emit-llvm \
// RUN: -triple spir64-unknown-unknown \
// RUN: -aux-triple x86_64-unknown-linux-gnu \
// RUN: -fsycl-is-device \
// RUN: -finclude-default-header \
// RUN: -debug-info-kind=limited -gno-column-info \
// RUN: | FileCheck %s
//
// In spir functions, validate the llvm.dbg.declare intrinsics created for
// parameters and locals refer to the stack allocation in the alloca address
// space.
//
#define KERNEL __attribute__((sycl_kernel))
template <typename KernelName, typename KernelType>
KERNEL void parallel_for(const KernelType &KernelFunc) {
KernelFunc();
}
[[clang::sycl_external]] void my_kernel(int my_param) {
int my_local = 0;
my_local = my_param;
}
int my_host() {
parallel_for<class K>([=]() { my_kernel(42); });
return 0;
}
// CHECK: define {{.*}}spir_func void @_Z9my_kerneli(
// CHECK-SAME i32 %my_param
// CHECK-SAME: !dbg [[MY_KERNEL:![0-9]+]]
// CHECK-SAME: {
// CHECK: %my_param.addr = alloca i32, align 4
// CHECK: %my_local = alloca i32, align 4
// CHECK: #dbg_declare(
// CHECK-SAME: ptr %my_param.addr,
// CHECK-SAME: [[MY_PARAM:![0-9]+]],
// CHECK-SAME: !DIExpression(DW_OP_constu, 4, DW_OP_swap, DW_OP_xderef)
// CHECK-SAME: )
// CHECK: #dbg_declare(
// CHECK-SAME: ptr %my_local,
// CHECK-SAME: [[MY_LOCAL:![0-9]+]],
// CHECK-SAME: !DIExpression(DW_OP_constu, 4, DW_OP_swap, DW_OP_xderef)
// CHECK-SAME: )
// CHECK: }
// CHECK: [[MY_KERNEL]] = distinct !DISubprogram(
// CHECK-SAME: name: "my_kernel"
// CHECK-SAME: )
// CHECK: [[MY_PARAM]] = !DILocalVariable(
// CHECK-SAME: name: "my_param"
// CHECK-SAME: arg: 1
// CHECK-SAME: scope: [[MY_KERNEL]]
// CHECK-SAME: )
// CHECK: [[MY_LOCAL]] = !DILocalVariable(
// CHECK-SAME: name: "my_local"
// CHECK-SAME: scope: [[MY_KERNEL]]
// CHECK-SAME: )