================ @@ -5,8 +5,46 @@ target datalayout = "A5" ; CHECK: in function test_dynamic_stackalloc{{.*}}: unsupported dynamic alloca -define amdgpu_kernel void @test_dynamic_stackalloc(ptr addrspace(1) %out, i32 %n) { +define amdgpu_kernel void @test_dynamic_stackalloc(i32 %n) { %alloca = alloca i32, i32 %n, addrspace(5) - store volatile i32 0, ptr addrspace(5) %alloca + store volatile i32 123, ptr addrspace(5) %alloca ret void } + +; CHECK: in function test_dynamic_stackalloc{{.*}}: unsupported dynamic alloca + +define amdgpu_kernel void @test_dynamic_stackalloc_multiple_allocas(i32 %n) { + %alloca1 = alloca i32, i32 8, addrspace(5) + %alloca2 = alloca i32, i32 %n, addrspace(5) + %alloca3 = alloca i32, i32 10, addrspace(5) + store volatile i32 1, ptr addrspace(5) %alloca1 + store volatile i32 2, ptr addrspace(5) %alloca2 + store volatile i32 3, ptr addrspace(5) %alloca3 + ret void +} + +; CHECK: in function test_dynamic_stackalloc{{.*}}: unsupported dynamic alloca + +define amdgpu_kernel void @test_dynamic_stackalloc_custom_alignment(i32 %n) { + %alloca = alloca i32, i32 %n, align 128, addrspace(5) + store volatile i32 1, ptr addrspace(5) %alloca + ret void +} + +; CHECK: in function test_dynamic_stackalloc{{.*}}: unsupported dynamic alloca + +define amdgpu_kernel void @test_dynamic_stackalloc_non_entry_block(i32 %n) { + entry: ---------------- arsenm wrote:
Indent is off https://github.com/llvm/llvm-project/pull/120063 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits