1// RUN: not llvm-mc -mattr=+code-object-v3 -triple amdgcn-amd-amdhsa -mcpu=gfx803 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s
2// RUN: not llvm-mc -mattr=+code-object-v3 -triple amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefix=GFX10
3// RUN: not llvm-mc -mattr=+code-object-v3 -triple amdgcn-amd- -mcpu=gfx803 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefix=NOT-AMDHSA
4
5.text
6
7.amdgcn_target "amdgcn--amdhsa-gfx803+xnack"
8// CHECK: error: target must match options
9
10.amdhsa_kernel
11// CHECK: error: unknown directive
12.end_amdhsa_kernel
13
14.amdhsa_kernel foo
15  .amdhsa_group_segment_fixed_size -1
16  // CHECK: error: value out of range
17.end_amdhsa_kernel
18
19.amdhsa_kernel foo
20  .amdhsa_group_segment_fixed_size 10000000000 + 1
21  // CHECK: error: value out of range
22.end_amdhsa_kernel
23
24.amdhsa_kernel foo
25  // NOT-AMDHSA: error: unknown directive
26.end_amdhsa_kernel
27
28.amdhsa_kernel foo
29  .amdhsa_group_segment_fixed_size 1
30  .amdhsa_group_segment_fixed_size 1
31  // CHECK: error: .amdhsa_ directives cannot be repeated
32.end_amdhsa_kernel
33
34.amdhsa_kernel foo
35  // CHECK: error: .amdhsa_next_free_vgpr directive is required
36.end_amdhsa_kernel
37
38.amdhsa_kernel foo
39  .amdhsa_next_free_vgpr 0
40  // CHECK: error: .amdhsa_next_free_sgpr directive is required
41.end_amdhsa_kernel
42
43.amdhsa_kernel foo
44  1
45  // CHECK: error: expected .amdhsa_ directive or .end_amdhsa_kernel
46.end_amdhsa_kernel
47
48.amdhsa_kernel foo
49  .amdhsa_wavefront_size32 1
50  // CHECK: error: directive requires gfx10+
51.end_amdhsa_kernel
52
53.amdhsa_kernel foo
54  .amdhsa_workgroup_processor_mode 1
55  // CHECK: error: directive requires gfx10+
56.end_amdhsa_kernel
57
58.amdhsa_kernel foo
59  .amdhsa_memory_ordered 1
60  // CHECK: error: directive requires gfx10+
61.end_amdhsa_kernel
62
63.amdhsa_kernel foo
64  .amdhsa_forward_progress 1
65  // CHECK: error: directive requires gfx10+
66.end_amdhsa_kernel
67
68.amdhsa_kernel foo
69  .amdhsa_wavefront_size32 5
70  // GFX10: error: value out of range
71.end_amdhsa_kernel
72
73.amdhsa_kernel foo
74  .amdhsa_workgroup_processor_mode 5
75  // GFX10: error: value out of range
76.end_amdhsa_kernel
77
78.amdhsa_kernel foo
79  .amdhsa_memory_ordered 5
80  // GFX10: error: value out of range
81.end_amdhsa_kernel
82
83.amdhsa_kernel foo
84  .amdhsa_forward_progress 5
85  // GFX10: error: value out of range
86.end_amdhsa_kernel
87
88.set .amdgcn.next_free_vgpr, "foo"
89v_mov_b32_e32 v0, s0
90// CHECK: error: .amdgcn.next_free_{v,s}gpr symbols must be absolute expressions
91