[llvm] [AMDGPU] Add test for failure with function !dbg info in amdgpu-lower-kernel-arguments (PR #126146)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 02:37:02 PST 2025


================
@@ -0,0 +1,27 @@
+; RUN: not --crash opt -mtriple=amdgcn-amd-amdhsa -mcpu=gfx940 -passes='amdgpu-attributor,function(amdgpu-lower-kernel-arguments)' -amdgpu-kernarg-preload-count=16 -S < %s 2>&1 | FileCheck %s
+
+; CHECK: function declaration may only have a unique !dbg attachment
+; CHECK-NEXT: ptr @0
+
+define amdgpu_kernel void @preload_block_count_x(ptr addrspace(1) %out) !dbg !4 {
+  %imp_arg_ptr = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
+  %load = load i32, ptr addrspace(4) %imp_arg_ptr, align 4
+  store i32 %load, ptr addrspace(1) %out, align 4
+  ret void
+}
+
+; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
----------------
arsenm wrote:

Drop comment 

https://github.com/llvm/llvm-project/pull/126146


More information about the llvm-commits mailing list