|
1 | 1 | // REQUIRES: amdgpu-registered-target |
2 | 2 | // RUN: %clang_cc1 -fsyntax-only -triple amdgcn -target-cpu gfx950 -verify %s -fcuda-is-device |
3 | 3 | // RUN: %clang_cc1 -fsyntax-only -triple x86_64 -aux-triple amdgcn -verify %s |
4 | | -// expected-no-diagnostics |
5 | 4 |
|
6 | 5 | #define __device__ __attribute__((device)) |
7 | 6 | #define __global__ __attribute__((global)) |
@@ -58,3 +57,29 @@ __global__ void i_am_kernel(void* src, __amdgpu_buffer_rsrc_t rsrc, __shared__ v |
58 | 57 | __builtin_amdgcn_global_load_lds(src, dst, 12, 0 , 0); |
59 | 58 | __builtin_amdgcn_global_load_lds(src, dst, 16, 0 , 0); |
60 | 59 | } |
| 60 | + |
| 61 | +__device__ void i_am_wrong(void* src, __amdgpu_buffer_rsrc_t rsrc, __shared__ void* dst, int vindex, int voffset, int soffset) { |
| 62 | + __builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, dst, 1, voffset, soffset, 0, 0, 4); |
| 63 | + __builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, dst, 2, voffset, soffset, 0, 0, 4); |
| 64 | + __builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, dst, 4, voffset, soffset, 0, 0, 4); |
| 65 | + __builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, dst, 12, voffset, soffset, 0, 0, 4); |
| 66 | + __builtin_amdgcn_raw_ptr_buffer_load_lds(rsrc, dst, 16, voffset, soffset, 0, 0, 4); |
| 67 | + |
| 68 | + __builtin_amdgcn_struct_ptr_buffer_load_lds(rsrc, dst, 1, vindex, voffset, soffset, 0, 0, 4); |
| 69 | + __builtin_amdgcn_struct_ptr_buffer_load_lds(rsrc, dst, 2, vindex, voffset, soffset, 0, 0, 4); |
| 70 | + __builtin_amdgcn_struct_ptr_buffer_load_lds(rsrc, dst, 4, vindex, voffset, soffset, 0, 0, 4); |
| 71 | + __builtin_amdgcn_struct_ptr_buffer_load_lds(rsrc, dst, 12, vindex, voffset, soffset, 0, 0, 4); |
| 72 | + __builtin_amdgcn_struct_ptr_buffer_load_lds(rsrc, dst, 16, vindex, voffset, soffset, 0, 0, 4); |
| 73 | + |
| 74 | + __builtin_amdgcn_load_to_lds(src, dst, 1, 0, 0, 4); // expected-error{{too many arguments to function call}} |
| 75 | + __builtin_amdgcn_load_to_lds(src, dst, 2, 0, 0, 4); // expected-error{{too many arguments to function call}} |
| 76 | + __builtin_amdgcn_load_to_lds(src, dst, 4, 0, 0, 4); // expected-error{{too many arguments to function call}} |
| 77 | + __builtin_amdgcn_load_to_lds(src, dst, 12, 0, 0, 4); // expected-error{{too many arguments to function call}} |
| 78 | + __builtin_amdgcn_load_to_lds(src, dst, 16, 0, 0, 4); // expected-error{{too many arguments to function call}} |
| 79 | + |
| 80 | + __builtin_amdgcn_global_load_lds(src, dst, 1, 0 , 0, 4); |
| 81 | + __builtin_amdgcn_global_load_lds(src, dst, 2, 0 , 0, 4); |
| 82 | + __builtin_amdgcn_global_load_lds(src, dst, 4, 0 , 0, 4); |
| 83 | + __builtin_amdgcn_global_load_lds(src, dst, 12, 0 , 0, 4); |
| 84 | + __builtin_amdgcn_global_load_lds(src, dst, 16, 0 , 0, 4); |
| 85 | +} |
0 commit comments