llvm-project/llvm/test/CodeGen/SPIRV/zero-length-array.ll
Juan Manuel Martinez Caamaño d0081aa929
[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.
2025-11-10 08:38:15 +00:00

19 lines
619 B
LLVM

; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - | FileCheck %s
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
; Nothing is generated, but compilation doesn't crash.
; CHECK: OpName %[[#FOO:]] "foo"
; CHECK: OpName %[[#RTM:]] "reg2mem alloca point"
; CHECK: %[[#INT:]] = OpTypeInt 32 0
; CHECK: %[[#RTM]] = OpConstant %[[#INT]] 0
; CHECK: %[[#FOO]] = OpFunction
; CHECK-NEXT: = OpLabel
; CHECK-NEXT: OpReturn
; CHECK-NEXT: OpFunctionEnd
define spir_func void @foo() {
entry:
%i = alloca [0 x i32], align 4
ret void
}