26 lines · plain
1// Tests CUDA kernel arguments get copied by value when targeting SPIR-V, even with2// destructor, copy constructor or move constructor defined by user.3 4// RUN: %clang -emit-llvm --cuda-device-only --offload=spirv32 \5// RUN: -nocudalib -nocudainc %s -o %t.bc -c 2>&16// RUN: llvm-dis %t.bc -o %t.ll7// RUN: FileCheck %s --input-file=%t.ll8 9// RUN: %clang -emit-llvm --cuda-device-only --offload=spirv64 \10// RUN: -nocudalib -nocudainc %s -o %t.bc -c 2>&111// RUN: llvm-dis %t.bc -o %t.ll12// RUN: FileCheck %s --input-file=%t.ll13 14class GpuData {15 public:16 __attribute__((host)) __attribute__((device)) GpuData(int* src) {}17 __attribute__((host)) __attribute__((device)) ~GpuData() {}18 __attribute__((host)) __attribute__((device)) GpuData(const GpuData& other) {}19 __attribute__((host)) __attribute__((device)) GpuData(GpuData&& other) {}20};21 22// CHECK: define23// CHECK-SAME: spir_kernel void @_Z6kernel7GpuData(ptr noundef byval(%class.GpuData) align24 25__attribute__((global)) void kernel(GpuData output) {}26