Debian Codegraph @

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

raw
1 ; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan-compute < %s | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan-compute %s -o - -filetype=obj | spirv-val %}
3
4 ; RUN: not llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown < %s 2>&1 | FileCheck -check-prefix=CHECK-ERR %s
5
6 ; For compute, nothing is generated, but compilation doesn't crash.
7 ; CHECK: OpName %[[#FOO:]] "foo"
8 ; CHECK: %[[#FOO]] = OpFunction
9 ; CHECK-NEXT: = OpLabel
10 ; CHECK-NEXT: OpReturn
11 ; CHECK-NEXT: OpFunctionEnd
12
13
14 ; For non-compute, error.
15 ; CHECK-ERR: LLVM ERROR: Runtime arrays are not allowed in non-shader SPIR-V modules
16
17 %struct.with_zero = type { i32, [0 x i32], i64 }
18
19 define spir_func void @foo() {
20 entry:
21 %i = alloca %struct.with_zero, align 64
22 ret void
23 }