| 1 |
; All OpVariable instructions in a function must be the first instructions in the first block |
| 2 |
|
| 3 |
; RUN: llc -O0 -mtriple=spirv32-unknown-linux %s -o - | FileCheck %s --check-prefix=CHECK-SPIRV |
| 4 |
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-linux %s -o - -filetype=obj | spirv-val %} |
| 5 |
|
| 6 |
; CHECK-SPIRV: OpFunction |
| 7 |
; CHECK-SPIRV-NEXT: OpLabel |
| 8 |
; CHECK-SPIRV-NEXT: OpVariable |
| 9 |
; CHECK-SPIRV-NEXT: OpVariable |
| 10 |
; CHECK-SPIRV: OpReturn |
| 11 |
; CHECK-SPIRV: OpFunctionEnd |
| 12 |
|
| 13 |
define void @main() { |
| 14 |
entry: |
| 15 |
%0 = alloca <2 x i32>, align 4 |
| 16 |
store <2 x i32> zeroinitializer, ptr %0, align 4 |
| 17 |
%1 = getelementptr <2 x i32>, ptr %0, i32 0, i32 0 |
| 18 |
%2 = alloca float, align 4 |
| 19 |
store float 0.0, ptr %2, align 4 |
| 20 |
ret void |
| 21 |
} |