Skip to content

Commit 0c3685e

Browse files
slinder1sivan-shani
authored andcommitted
[AMDGPU] Add test for failure with function !dbg info in amdgpu-lower-kernel-arguments (llvm#126146)
1 parent 637fc3b commit 0c3685e

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
; 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
2+
3+
; CHECK: function declaration may only have a unique !dbg attachment
4+
; CHECK-NEXT: ptr @0
5+
6+
define amdgpu_kernel void @preload_block_count_x(ptr addrspace(1) %out) !dbg !4 !max_work_group_size !7 {
7+
%imp_arg_ptr = call ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr()
8+
%load = load i32, ptr addrspace(4) %imp_arg_ptr, align 4
9+
store i32 %load, ptr addrspace(1) %out, align 4
10+
ret void
11+
}
12+
13+
declare noundef align 4 ptr addrspace(4) @llvm.amdgcn.implicitarg.ptr() #0
14+
15+
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
16+
17+
!llvm.dbg.cu = !{!0}
18+
!llvm.module.flags = !{!2, !3}
19+
20+
!0 = distinct !DICompileUnit(language: DW_LANG_OpenCL, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
21+
!1 = !DIFile(filename: "<stdin>", directory: "/")
22+
!2 = !{i32 7, !"Dwarf Version", i32 5}
23+
!3 = !{i32 2, !"Debug Info Version", i32 3}
24+
!4 = distinct !DISubprogram(name: "test", scope: !1, file: !1, line: 1, type: !5, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0)
25+
!5 = !DISubroutineType(cc: DW_CC_LLVM_OpenCLKernel, types: !6)
26+
!6 = !{null}
27+
!7 = !{i32 1024, i32 1, i32 1}

0 commit comments

Comments
 (0)