xref: /llvm-project/llvm/test/MC/AMDGPU/user-sgpr-count-diag.s (revision 4428b01faa41bb9afd75ae88c3ecbdb480a83e4d)
1// RUN: not llvm-mc --amdhsa-code-object-version=4 -triple amdgcn-amd-amdhsa -mcpu=gfx90a %s 2>&1 >/dev/null | FileCheck -check-prefix=ERR %s
2
3.amdhsa_kernel implied_count_too_low_0
4  .amdhsa_user_sgpr_count 0
5  .amdhsa_user_sgpr_queue_ptr 1
6  .amdhsa_accum_offset 4
7  .amdhsa_next_free_vgpr 32
8  .amdhsa_next_free_sgpr 32
9// ERR: :[[@LINE+1]]:19: error: amdgpu_user_sgpr_count smaller than than implied by enabled user SGPRs
10.end_amdhsa_kernel
11
12.amdhsa_kernel implied_count_too_low_1
13  .amdhsa_user_sgpr_count 1
14  .amdhsa_user_sgpr_queue_ptr 1
15  .amdhsa_accum_offset 4
16  .amdhsa_next_free_vgpr 32
17  .amdhsa_next_free_sgpr 32
18// ERR: :[[@LINE+1]]:19: error: amdgpu_user_sgpr_count smaller than than implied by enabled user SGPRs
19.end_amdhsa_kernel
20
21.amdhsa_kernel implied_count_too_low_2
22  .amdhsa_user_sgpr_count 2
23  .amdhsa_user_sgpr_queue_ptr 1
24  .amdhsa_user_sgpr_kernarg_preload_length 1
25  .amdhsa_accum_offset 4
26  .amdhsa_next_free_vgpr 32
27  .amdhsa_next_free_sgpr 32
28// ERR: :[[@LINE+1]]:19: error: amdgpu_user_sgpr_count smaller than than implied by enabled user SGPRs
29.end_amdhsa_kernel
30
31.amdhsa_kernel preload_out_of_bounds_0
32  .amdhsa_user_sgpr_count 4
33  .amdhsa_user_sgpr_queue_ptr 1
34  .amdhsa_user_sgpr_kernarg_preload_length 1
35  .amdhsa_user_sgpr_kernarg_preload_offset 1
36  .amdhsa_kernarg_size 4
37  .amdhsa_accum_offset 4
38  .amdhsa_next_free_vgpr 32
39  .amdhsa_next_free_sgpr 32
40// ERR: :[[@LINE+1]]:19: error: Kernarg preload length + offset is larger than the kernarg segment size
41.end_amdhsa_kernel
42