Skip to content

Commit d0081aa

Browse files
authored
[NFC][SPIRV] Make the zero-length-array.ll test explicit about what is generated (#166910)
This patch doesn't change anything. Just adds more explicit checks to verify what is generated in this case when an alloca has a zero-sized array. I'd expect an `OpRuntimeArray`, but nothing is generated.
1 parent abdb9a0 commit d0081aa

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

llvm/test/CodeGen/SPIRV/zero-length-array.ll

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - | FileCheck %s
22
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
33

4-
; CHECK: %[[#type:]] = OpTypeInt 32 0
5-
; CHECK: %[[#ext:]] = OpConstant %[[#type]] 0
4+
; Nothing is generated, but compilation doesn't crash.
5+
; CHECK: OpName %[[#FOO:]] "foo"
6+
; CHECK: OpName %[[#RTM:]] "reg2mem alloca point"
7+
; CHECK: %[[#INT:]] = OpTypeInt 32 0
8+
; CHECK: %[[#RTM]] = OpConstant %[[#INT]] 0
9+
; CHECK: %[[#FOO]] = OpFunction
10+
; CHECK-NEXT: = OpLabel
11+
; CHECK-NEXT: OpReturn
12+
; CHECK-NEXT: OpFunctionEnd
613

7-
define spir_func void @_Z3foov() {
14+
define spir_func void @foo() {
815
entry:
916
%i = alloca [0 x i32], align 4
1017
ret void

0 commit comments

Comments
 (0)