Skip to content

Commit 0e6deea

Browse files
committed
Added small unit test for symbol checking
1 parent d109aac commit 0e6deea

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
; RUN: llc -mtriple=nvptx64-nvidia-cuda -mcpu=sm_86 < %s | FileCheck %s
2+
3+
; CHECK: .global .align 1 .b8 __func___$__Z10foo_kernelv
4+
5+
; ModuleID = 'test_module'
6+
source_filename = "test_module.cu"
7+
target datalayout = "e-i64:64-i128:128-v16:16-v32:32-n16:32:64"
8+
target triple = "nvptx64-nvidia-cuda"
9+
10+
@__func__._Z10foo_kernelv = private unnamed_addr constant [11 x i8] c"foo_kernel\00", align 1, !dbg !0
11+
12+
define dso_local void @_Z10foo_kernelv() #0 !dbg !20 {
13+
entry:
14+
call void @_Z6escapePKc(ptr noundef @__func__._Z10foo_kernelv) #2, !dbg !23
15+
ret void, !dbg !24
16+
}
17+
18+
declare dso_local void @_Z6escapePKc(ptr noundef)
19+
20+
attributes #0 = { noinline nounwind optnone "target-cpu"="sm_86" }
21+
attributes #1 = { nounwind }
22+
attributes #2 = { nounwind }
23+
24+
!llvm.dbg.cu = !{!14}
25+
!llvm.ident = !{!18}
26+
27+
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
28+
!1 = distinct !DIGlobalVariable(scope: null, file: !2, name: "__func__", linkageName: "__func__._Z10foo_kernelv", line: 6, type: !3, isLocal: true, isDefinition: true)
29+
!2 = !DIFile(filename: "test_module.cu", directory: "/")
30+
!3 = !DICompositeType(tag: DW_TAG_array_type, baseType: !4, size: 88, elements: !6)
31+
!4 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !5)
32+
!5 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
33+
!6 = !{!7}
34+
!7 = !DISubrange(count: 11)
35+
!14 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !2, producer: "clang version 20.0.0git", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !16, nameTableKind: None)
36+
!16 = !{!0}
37+
!18 = !{!"clang version 20.0.0git"}
38+
!20 = distinct !DISubprogram(name: "foo_kernel", linkageName: "_Z10foo_kernelv", scope: !2, file: !2, line: 4, type: !21, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !14)
39+
!21 = !DISubroutineType(types: !22)
40+
!22 = !{null}
41+
!23 = !DILocation(line: 6, column: 5, scope: !20)
42+
!24 = !DILocation(line: 7, column: 1, scope: !20)

0 commit comments

Comments
 (0)