Debian Codegraph @

llvm/test/CodeGen/SPIRV/legalize-zero-size-arrays-alloca-nested.ll

raw
1 ; RUN: opt -S -passes=spirv-legalize-zero-size-arrays -mtriple=spirv64-unknown-unknown < %s | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown -spirv-ext=+SPV_INTEL_variable_length_array %s -o - -filetype=obj | spirv-val %}
3
4 ; Test that zero-size array alloca with nested arrays allocates element type.
5 define ptr @test_alloca_with_count(i32 %n) {
6 ; CHECK-LABEL: @test_alloca_with_count(
7 ; CHECK-NEXT: [[ARR:%.*]] = alloca ptr addrspace(4), align 4
8 ; CHECK-NEXT: ret ptr [[ARR]]
9 %arr = alloca [0 x [0 x [0 x i32] ] ], align 4
10 ret ptr %arr
11 }