1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 define spir_kernel void @foo(ptr addrspace(1) %arg) !kernel_arg_addr_space !1 !kernel_arg_access_qual !2 !kernel_arg_type !3 !kernel_arg_base_type !3 !kernel_arg_type_qual !4 {
5 %var = alloca ptr addrspace(1), align 8
6 ; CHECK: %[[#VAR:]] = OpVariable %[[#]] Function
7 store ptr addrspace(1) %arg, ptr %var, align 8
8 ; The test itends to verify that OpStore uses OpVariable result directly (without a bitcast).
9 ; Other type checking is done by spirv-val.
10 ; CHECK: OpStore %[[#VAR]] %[[#]] Aligned 8
11 %lod = load ptr addrspace(1), ptr %var, align 8
12 %idx = getelementptr inbounds i64, ptr addrspace(1) %lod, i64 0