1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mattr=+code-object-v3 -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readelf --notes | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mattr=+code-object-v3 -mcpu=gfx900 -amdgpu-dump-hsa-metadata -amdgpu-verify-hsa-metadata -filetype=obj -o - < %s 2>&1 | FileCheck --check-prefix=PARSER %s
5 ; CHECK: amdhsa.kernels:
7 ; CHECK-NEXT: - .name: a
8 ; CHECK-NEXT: .offset: 0
10 ; CHECK-NEXT: .type_name: char
11 ; CHECK-NEXT: .value_kind: by_value
12 ; CHECK-NEXT: .value_type: i8
13 ; CHECK-NEXT: - .offset: 8
14 ; CHECK-NEXT: .size: 8
15 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
16 ; CHECK-NEXT: .value_type: i64
17 ; CHECK-NEXT: - .offset: 16
18 ; CHECK-NEXT: .size: 8
19 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
20 ; CHECK-NEXT: .value_type: i64
21 ; CHECK-NEXT: - .offset: 24
22 ; CHECK-NEXT: .size: 8
23 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
24 ; CHECK-NEXT: .value_type: i64
25 ; CHECK-NOT: .value_kind: hidden_default_queue
26 ; CHECK-NOT: .value_kind: hidden_completion_action
27 ; CHECK: .language: OpenCL C
28 ; CHECK-NEXT: .language_version:
31 ; CHECK: .name: test_non_enqueue_kernel_caller
32 ; CHECK: .symbol: test_non_enqueue_kernel_caller.kd
33 define amdgpu_kernel void @test_non_enqueue_kernel_caller(i8 %a) #0
34 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
35 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
40 ; CHECK-NEXT: - .name: a
41 ; CHECK-NEXT: .offset: 0
42 ; CHECK-NEXT: .size: 1
43 ; CHECK-NEXT: .type_name: char
44 ; CHECK-NEXT: .value_kind: by_value
45 ; CHECK-NEXT: .value_type: i8
46 ; CHECK-NEXT: - .offset: 8
47 ; CHECK-NEXT: .size: 8
48 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
49 ; CHECK-NEXT: .value_type: i64
50 ; CHECK-NEXT: - .offset: 16
51 ; CHECK-NEXT: .size: 8
52 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
53 ; CHECK-NEXT: .value_type: i64
54 ; CHECK-NEXT: - .offset: 24
55 ; CHECK-NEXT: .size: 8
56 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
57 ; CHECK-NEXT: .value_type: i64
58 ; CHECK-NEXT: - .address_space: global
59 ; CHECK-NEXT: .offset: 32
60 ; CHECK-NEXT: .size: 8
61 ; CHECK-NEXT: .value_kind: hidden_none
62 ; CHECK-NEXT: .value_type: i8
63 ; CHECK-NEXT: - .address_space: global
64 ; CHECK-NEXT: .offset: 40
65 ; CHECK-NEXT: .size: 8
66 ; CHECK-NEXT: .value_kind: hidden_default_queue
67 ; CHECK-NEXT: .value_type: i8
68 ; CHECK-NEXT: - .address_space: global
69 ; CHECK-NEXT: .offset: 48
70 ; CHECK-NEXT: .size: 8
71 ; CHECK-NEXT: .value_kind: hidden_completion_action
72 ; CHECK-NEXT: .value_type: i8
73 ; CHECK: .language: OpenCL C
74 ; CHECK-NEXT: .language_version:
77 ; CHECK: .name: test_enqueue_kernel_caller
78 ; CHECK: .symbol: test_enqueue_kernel_caller.kd
79 define amdgpu_kernel void @test_enqueue_kernel_caller(i8 %a) #1
80 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
81 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
85 ; CHECK: amdhsa.version:
88 ; CHECK-NOT: amdhsa.printf:
90 attributes #0 = { "amdgpu-implicitarg-num-bytes"="48" }
91 attributes #1 = { "calls-enqueue-kernel" "amdgpu-implicitarg-num-bytes"="48" }
98 !opencl.ocl.version = !{!90}
101 ; PARSER: AMDGPU HSA Metadata Parser Test: PASS