1; RUN: llc < %s -march=amdgcn -verify-machineinstrs | FileCheck --check-prefix=SI --check-prefix=FUNC %s
2; RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck --check-prefix=EG --check-prefix=FUNC %s
3
4; Make sure the OpenCL Image lowering pass doesn't crash when argument metadata
5; is not in expected order.
6
7; EG: CF_END
8; SI: s_endpgm
9define amdgpu_kernel void @kernel(i32 addrspace(1)* %out) {
10entry:
11  store i32 0, i32 addrspace(1)* %out
12  ret void
13}
14
15attributes #3 = { nounwind }
16
17!opencl.kernels = !{!0}
18
19!0 = !{void (i32 addrspace(1)*)* @kernel, !1, !2, !3, !4, !5}
20!1 = !{!"kernel_arg_addr_space", i32 0}
21!2 = !{!"kernel_arg_access_qual", !"none"}
22!3 = !{!"kernel_arg_type", !"int*"}
23!4 = !{!"kernel_arg_type_qual", !""}
24!5 = !{!"kernel_arg_name", !""}
25