1 ;; Check duplicate operands in opencl.ocl.version metadata is accepted without
4 ; RUN: llc -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
6 %struct.my_struct_t = type { i8, i32 }
8 @var = addrspace(1) global %struct.my_struct_t { i8 97, i32 42 }, align 4
10 define spir_kernel void @__OpenCL_writer_kernel(i8 zeroext %c, i32 %i) {
12 %c.addr = alloca i8, align 1
13 %i.addr = alloca i32, align 4
14 store i8 %c, i8* %c.addr, align 1
15 store i32 %i, i32* %i.addr, align 4
16 %0 = load i8, i8* %c.addr, align 1
17 store i8 %0, i8 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 0), align 1
18 %1 = load i32, i32* %i.addr, align 4
19 store i32 %1, i32 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 1), align 4
23 define spir_kernel void @__OpenCL_reader_kernel(i8 addrspace(1)* %C, i32 addrspace(1)* %I) {
25 %C.addr = alloca i8 addrspace(1)*, align 8
26 %I.addr = alloca i32 addrspace(1)*, align 8
27 store i8 addrspace(1)* %C, i8 addrspace(1)** %C.addr, align 8
28 store i32 addrspace(1)* %I, i32 addrspace(1)** %I.addr, align 8
29 %0 = load i8, i8 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 0), align 1
30 %1 = load i8 addrspace(1)*, i8 addrspace(1)** %C.addr, align 8
31 store i8 %0, i8 addrspace(1)* %1, align 1
32 %2 = load i32, i32 addrspace(1)* getelementptr inbounds (%struct.my_struct_t, %struct.my_struct_t addrspace(1)* @var, i32 0, i32 1), align 4
33 %3 = load i32 addrspace(1)*, i32 addrspace(1)** %I.addr, align 8
34 store i32 %2, i32 addrspace(1)* %3, align 4
38 ;; "cl_images" should be encoded as BasicImage capability,
39 ;; but images are not used in this test case, so this capability is not required.
40 ; CHECK-NOT: OpExtension "cl_images"
41 ; CHECK-DAG: OpSourceExtension "cl_khr_int64_base_atomics"
42 ; CHECK-DAG: OpSourceExtension "cl_khr_int64_extended_atomics"
43 ; CHECK: OpSource OpenCL_C 200000
45 !opencl.ocl.version = !{!13, !13}
46 !opencl.used.extensions = !{!24, !25}
49 !24 = !{!"cl_khr_int64_base_atomics"}
50 !25 = !{!"cl_khr_int64_base_atomics", !"cl_khr_int64_extended_atomics"}