22 lines · plain
1; All OpVariable instructions in a function must be the first instructions in the first block2 3; RUN: llc -O0 -mtriple=spirv32-unknown-linux %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV4; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-linux %s -o - -filetype=obj | spirv-val %}5 6; CHECK-SPIRV: OpFunction7; CHECK-SPIRV-NEXT: OpLabel8; CHECK-SPIRV-NEXT: OpVariable9; CHECK-SPIRV-NEXT: OpVariable10; CHECK-SPIRV: OpReturn11; CHECK-SPIRV: OpFunctionEnd12 13define void @main() {14entry:15 %0 = alloca <2 x i32>, align 416 store <2 x i32> zeroinitializer, ptr %0, align 417 %1 = getelementptr <2 x i32>, ptr %0, i32 0, i32 018 %2 = alloca float, align 419 store float 0.0, ptr %2, align 420 ret void21}22