1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 --amdhsa-code-object-version=3 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK %s
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 --amdhsa-code-object-version=3 -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: - .offset: 8
13 ; CHECK-NEXT: .size: 8
14 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
15 ; CHECK-NEXT: - .offset: 16
16 ; CHECK-NEXT: .size: 8
17 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
18 ; CHECK-NEXT: - .offset: 24
19 ; CHECK-NEXT: .size: 8
20 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
21 ; CHECK-NOT: .value_kind: hidden_default_queue
22 ; CHECK-NOT: .value_kind: hidden_completion_action
23 ; CHECK: .language: OpenCL C
24 ; CHECK-NEXT: .language_version:
27 ; CHECK: .name: test_non_enqueue_kernel_caller
28 ; CHECK: .symbol: test_non_enqueue_kernel_caller.kd
29 define amdgpu_kernel void @test_non_enqueue_kernel_caller(i8 %a) #0
30 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
31 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
36 ; CHECK-NEXT: - .name: a
37 ; CHECK-NEXT: .offset: 0
38 ; CHECK-NEXT: .size: 1
39 ; CHECK-NEXT: .type_name: char
40 ; CHECK-NEXT: .value_kind: by_value
41 ; CHECK-NEXT: - .offset: 8
42 ; CHECK-NEXT: .size: 8
43 ; CHECK-NEXT: .value_kind: hidden_global_offset_x
44 ; CHECK-NEXT: - .offset: 16
45 ; CHECK-NEXT: .size: 8
46 ; CHECK-NEXT: .value_kind: hidden_global_offset_y
47 ; CHECK-NEXT: - .offset: 24
48 ; CHECK-NEXT: .size: 8
49 ; CHECK-NEXT: .value_kind: hidden_global_offset_z
50 ; CHECK-NEXT: - .offset: 32
51 ; CHECK-NEXT: .size: 8
52 ; CHECK-NEXT: .value_kind: hidden_hostcall_buffer
53 ; CHECK-NEXT: - .offset: 40
54 ; CHECK-NEXT: .size: 8
55 ; CHECK-NEXT: .value_kind: hidden_default_queue
56 ; CHECK-NEXT: - .offset: 48
57 ; CHECK-NEXT: .size: 8
58 ; CHECK-NEXT: .value_kind: hidden_completion_action
59 ; CHECK: .language: OpenCL C
60 ; CHECK-NEXT: .language_version:
63 ; CHECK: .name: test_enqueue_kernel_caller
64 ; CHECK: .symbol: test_enqueue_kernel_caller.kd
65 define amdgpu_kernel void @test_enqueue_kernel_caller(i8 %a) #1
66 !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3
67 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
71 ; CHECK: amdhsa.version:
74 ; CHECK-NOT: amdhsa.printf:
76 attributes #0 = { optnone noinline "amdgpu-implicitarg-num-bytes"="48" }
77 attributes #1 = { optnone noinline "calls-enqueue-kernel" "amdgpu-implicitarg-num-bytes"="48" }
84 !opencl.ocl.version = !{!90}
87 ; PARSER: AMDGPU HSA Metadata Parser Test: PASS