1; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx700 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK --check-prefix=GFX700 --check-prefix=NOTES %s
2; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx802 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK --check-prefix=GFX802 --check-prefix=NOTES %s
3; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -filetype=obj -o - < %s | llvm-readelf --notes - | FileCheck --check-prefix=CHECK --check-prefix=GFX900 --check-prefix=NOTES %s
4
5%opencl.image1d_t = type opaque
6%opencl.image1d_array_t = type opaque
7%opencl.image1d_buffer_t = type opaque
8%opencl.image2d_t = type opaque
9%opencl.image2d_array_t = type opaque
10%opencl.image2d_array_depth_t = type opaque
11%opencl.image2d_array_msaa_t = type opaque
12%opencl.image2d_array_msaa_depth_t = type opaque
13%opencl.image2d_depth_t = type opaque
14%opencl.image2d_msaa_t = type opaque
15%opencl.image2d_msaa_depth_t = type opaque
16%opencl.image3d_t = type opaque
17
18; CHECK:         ---
19; CHECK: amdhsa.kernels:
20; CHECK:   - .args:
21; CHECK:       - .address_space:  global
22; CHECK:         .name:           a
23; CHECK:         .offset:         0
24; CHECK:         .size:           8
25; CHECK:         .type_name:      image1d_t
26; CHECK:         .value_kind:     image
27; CHECK:       - .address_space:  global
28; CHECK:         .name:           b
29; CHECK:         .offset:         8
30; CHECK:         .size:           8
31; CHECK:         .type_name:      image1d_array_t
32; CHECK:         .value_kind:     image
33; CHECK:       - .address_space:  global
34; CHECK:         .name:           c
35; CHECK:         .offset:         16
36; CHECK:         .size:           8
37; CHECK:         .type_name:      image1d_buffer_t
38; CHECK:         .value_kind:     image
39; CHECK:       - .address_space:  global
40; CHECK:         .name:           d
41; CHECK:         .offset:         24
42; CHECK:         .size:           8
43; CHECK:         .type_name:      image2d_t
44; CHECK:         .value_kind:     image
45; CHECK:       - .address_space:  global
46; CHECK:         .name:           e
47; CHECK:         .offset:         32
48; CHECK:         .size:           8
49; CHECK:         .type_name:      image2d_array_t
50; CHECK:         .value_kind:     image
51; CHECK:       - .address_space:  global
52; CHECK:         .name:           f
53; CHECK:         .offset:         40
54; CHECK:         .size:           8
55; CHECK:         .type_name:      image2d_array_depth_t
56; CHECK:         .value_kind:     image
57; CHECK:       - .address_space:  global
58; CHECK:         .name:           g
59; CHECK:         .offset:         48
60; CHECK:         .size:           8
61; CHECK:         .type_name:      image2d_array_msaa_t
62; CHECK:         .value_kind:     image
63; CHECK:       - .address_space:  global
64; CHECK:         .name:           h
65; CHECK:         .offset:         56
66; CHECK:         .size:           8
67; CHECK:         .type_name:      image2d_array_msaa_depth_t
68; CHECK:         .value_kind:     image
69; CHECK:       - .address_space:  global
70; CHECK:         .name:           i
71; CHECK:         .offset:         64
72; CHECK:         .size:           8
73; CHECK:         .type_name:      image2d_depth_t
74; CHECK:         .value_kind:     image
75; CHECK:       - .address_space:  global
76; CHECK:         .name:           j
77; CHECK:         .offset:         72
78; CHECK:         .size:           8
79; CHECK:         .type_name:      image2d_msaa_t
80; CHECK:         .value_kind:     image
81; CHECK:       - .address_space:  global
82; CHECK:         .name:           k
83; CHECK:         .offset:         80
84; CHECK:         .size:           8
85; CHECK:         .type_name:      image2d_msaa_depth_t
86; CHECK:         .value_kind:     image
87; CHECK:       - .address_space:  global
88; CHECK:         .name:           l
89; CHECK:         .offset:         88
90; CHECK:         .size:           8
91; CHECK:         .type_name:      image3d_t
92; CHECK:         .value_kind:     image
93define amdgpu_kernel void @test(%opencl.image1d_t addrspace(1)* %a,
94                                %opencl.image1d_array_t addrspace(1)* %b,
95                                %opencl.image1d_buffer_t addrspace(1)* %c,
96                                %opencl.image2d_t addrspace(1)* %d,
97                                %opencl.image2d_array_t addrspace(1)* %e,
98                                %opencl.image2d_array_depth_t addrspace(1)* %f,
99                                %opencl.image2d_array_msaa_t addrspace(1)* %g,
100                                %opencl.image2d_array_msaa_depth_t addrspace(1)* %h,
101                                %opencl.image2d_depth_t addrspace(1)* %i,
102                                %opencl.image2d_msaa_t addrspace(1)* %j,
103                                %opencl.image2d_msaa_depth_t addrspace(1)* %k,
104                                %opencl.image3d_t addrspace(1)* %l)
105    !kernel_arg_type !1 !kernel_arg_base_type !1 {
106  ret void
107}
108
109; CHECK:  amdhsa.version:
110; CHECK-NEXT: - 1
111; CHECK-NEXT: - 0
112
113!1 = !{!"image1d_t", !"image1d_array_t", !"image1d_buffer_t",
114       !"image2d_t", !"image2d_array_t", !"image2d_array_depth_t",
115       !"image2d_array_msaa_t", !"image2d_array_msaa_depth_t",
116       !"image2d_depth_t", !"image2d_msaa_t", !"image2d_msaa_depth_t",
117       !"image3d_t"}
118