Skip to content

Commit 0f6b671

Browse files
authored
[OpenCL] Add test for __kernel_exec macro (llvm#138287)
The `__kernel_exec` macro is mandated by the OpenCL C specification and supplied by `opencl-c-base.h`, but it was not covered in any tests.
1 parent 5c3d679 commit 0f6b671

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clang/test/CodeGenOpenCL/kernel-attributes.cl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: %clang_cc1 -emit-llvm -o - %s | FileCheck %s
1+
// RUN: %clang_cc1 -fdeclare-opencl-builtins -finclude-default-header -emit-llvm -o - %s | FileCheck %s
22

33
typedef unsigned int uint4 __attribute__((ext_vector_type(4)));
44

@@ -11,8 +11,13 @@ kernel __attribute__((vec_type_hint(uint4))) __attribute__((work_group_size_hint
1111
kernel __attribute__((intel_reqd_sub_group_size(8))) void kernel3(int a) {}
1212
// CHECK: define {{(dso_local )?}}spir_kernel void @kernel3(i32 {{[^%]*}}%a) {{[^{]+}} !intel_reqd_sub_group_size ![[MD5:[0-9]+]]
1313

14+
__kernel_exec(32, float) void kernel_from_exec(int a) {}
15+
// CHECK: define {{(dso_local )?}}spir_kernel void @kernel_from_exec(i32 {{[^%]*}}%a) {{[^{]+}} !vec_type_hint ![[MD6:[0-9]+]] !work_group_size_hint ![[MD7:[0-9]+]]
16+
1417
// CHECK: [[MD1]] = !{i32 poison, i32 1}
1518
// CHECK: [[MD2]] = !{i32 1, i32 2, i32 4}
1619
// CHECK: [[MD3]] = !{<4 x i32> poison, i32 0}
1720
// CHECK: [[MD4]] = !{i32 8, i32 16, i32 32}
1821
// CHECK: [[MD5]] = !{i32 8}
22+
// CHECK: [[MD6]] = !{float poison, i32 0}
23+
// CHECK: [[MD7]] = !{i32 32, i32 1, i32 1}

0 commit comments

Comments
 (0)