Skip to content

Commit a4683c4

Browse files
committed
Add tests case outside of struct
1 parent 1eecbd4 commit a4683c4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,19 @@ __device__ __amdgpu_buffer_rsrc_t test_simple_builtin(void *p, short stride, int
2121
__device__ void test_target_dependant_builtin(void *src, __shared__ void *dst) {
2222
S::global_load_lds_lambda(src, dst);
2323
}
24+
25+
constexpr auto make_buffer_rsrc_lambda = [](void *p, short stride, int num, int flags) {
26+
return __builtin_amdgcn_make_buffer_rsrc(p, stride, num, flags);
27+
};
28+
29+
constexpr auto global_load_lds_lambda = [](void* src, __shared__ void *dst) {
30+
__builtin_amdgcn_global_load_lds(src, dst, 16, 0, 0); // expected-error{{invalid size value}} expected-note{{size must be 1, 2, or 4}}
31+
};
32+
33+
__device__ __amdgpu_buffer_rsrc_t global_test_simple_builtin(void *p, short stride, int num, int flags) {
34+
return make_buffer_rsrc_lambda(p, stride, num, flags);
35+
}
36+
37+
__device__ void lobal_test_target_dependant_builtin(void *src, __shared__ void *dst) {
38+
global_load_lds_lambda(src, dst);
39+
}

0 commit comments

Comments
 (0)