llvm-project/clang/test/CodeGenOpenCL/amdgpu-call-kernel.cl
Haopeng Liu 4d6e69143d
Add the initializes attribute inference (#117104)
reland https://github.com/llvm/llvm-project/pull/97373 after fixing
clang tests.

Confirmed with "ninja check-llvm" and "ninja check-clang"
2024-11-20 19:15:23 -08:00

15 lines
450 B
Common Lisp
Executable File

// REQUIRES: amdgpu-registered-target
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -emit-llvm -o - %s | FileCheck %s
// CHECK: define{{.*}} amdgpu_kernel void @test_call_kernel(ptr addrspace(1) nocapture noundef writeonly align 4 initializes((0, 4)) %out)
// CHECK: store i32 4, ptr addrspace(1) %out, align 4
kernel void test_kernel(global int *out)
{
out[0] = 4;
}
__kernel void test_call_kernel(__global int *out)
{
test_kernel(out);
}