xref: /llvm-project/llvm/test/CodeGen/AMDGPU/attr-amdgpu-num-workgroups_error_check.ll (revision c4e517f59c086eafe2eb61d23197820f05be799c)
1; RUN: not llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s 2>&1 | FileCheck --check-prefix=ERROR %s
2
3; ERROR: error: can't parse integer attribute -1 in amdgpu-max-num-workgroups
4define amdgpu_kernel void @empty_max_num_workgroups_neg_num1() #21 {
5entry:
6  ret void
7}
8attributes #21 = {"amdgpu-max-num-workgroups"="-1,2,3"}
9
10; ERROR: error: can't parse integer attribute -2 in amdgpu-max-num-workgroups
11define amdgpu_kernel void @empty_max_num_workgroups_neg_num2() #22 {
12entry:
13  ret void
14}
15attributes #22 = {"amdgpu-max-num-workgroups"="1,-2,3"}
16
17; ERROR: error: can't parse integer attribute -3 in amdgpu-max-num-workgroups
18define amdgpu_kernel void @empty_max_num_workgroups_neg_num3() #23 {
19entry:
20  ret void
21}
22attributes #23 = {"amdgpu-max-num-workgroups"="1,2,-3"}
23
24; ERROR: error: can't parse integer attribute 1.0 in amdgpu-max-num-workgroups
25define amdgpu_kernel void @empty_max_num_workgroups_non_int1() #31 {
26entry:
27  ret void
28}
29attributes #31 = {"amdgpu-max-num-workgroups"="1.0,2,3"}
30
31; ERROR: error: can't parse integer attribute 2.0 in amdgpu-max-num-workgroups
32define amdgpu_kernel void @empty_max_num_workgroups_non_int2() #32 {
33entry:
34  ret void
35}
36attributes #32 = {"amdgpu-max-num-workgroups"="1,2.0,3"}
37
38; ERROR: error: can't parse integer attribute 3.0 in amdgpu-max-num-workgroups
39define amdgpu_kernel void @empty_max_num_workgroups_non_int3() #33 {
40entry:
41  ret void
42}
43attributes #33 = {"amdgpu-max-num-workgroups"="1,2,3.0"}
44
45; ERROR: error: can't parse integer attribute 10000000000 in amdgpu-max-num-workgroups
46define amdgpu_kernel void @empty_max_num_workgroups_too_large() #41 {
47entry:
48  ret void
49}
50attributes #41 = {"amdgpu-max-num-workgroups"="10000000000,2,3"}
51
52; ERROR: error: attribute amdgpu-max-num-workgroups has incorrect number of integers; expected 3
53define amdgpu_kernel void @empty_max_num_workgroups_1_arg() #51 {
54entry:
55  ret void
56}
57attributes #51 = {"amdgpu-max-num-workgroups"="1"}
58
59; ERROR: error: attribute amdgpu-max-num-workgroups has incorrect number of integers; expected 3
60define amdgpu_kernel void @empty_max_num_workgroups_2_args() #52 {
61entry:
62  ret void
63}
64attributes #52 = {"amdgpu-max-num-workgroups"="1,2"}
65
66; ERROR: error: attribute amdgpu-max-num-workgroups has incorrect number of integers; expected 3
67define amdgpu_kernel void @empty_max_num_workgroups_4_args() #53 {
68entry:
69  ret void
70}
71attributes #53 = {"amdgpu-max-num-workgroups"="1,2,3,4"}
72