File: debug_line_and_info_dedupe.test

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (130 lines) | stat: -rw-r--r-- 5,870 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
RUN: rm -rf %t && mkdir -p %t
RUN: split-file %s %t

RUN: llc -O0 -cas-friendly-debug-info --filetype=obj --cas-backend --cas=%t/cas --mccas-casid %t/a.ll -o %t/a.id
RUN: llc -O0 -cas-friendly-debug-info --filetype=obj --cas-backend --cas=%t/cas --mccas-casid %t/b.ll -o %t/b.id
RUN: llvm-cas-dump --die-refs --cas=%t/cas --casid-file %t/a.id %t/b.id | FileCheck %s

CHECK: mc:debug_DIE_top_level
CHECK: CAS Block: llvmcas://
CHECK-NEXT: DW_TAG_compile_unit
CHECK: CAS Block: llvmcas://[[SUBPROGRAM_FOO:[a-z0-9]+]]
CHECK-NEXT: DW_TAG_subprogram
CHECK: mc:debug_line   llvmcas://
CHECK-NEXT: mc:debug_line   llvmcas://[[LINETABLECASID:[a-z0-9]+]]
CHECK-NEXT: mc:debug_line   llvmcas://


CHECK: mc:assembler
CHECK: mc:debug_DIE_top_level
CHECK: DW_TAG_compile_unit
CHECK: CAS Block: llvmcas://[[SUBPROGRAM_FOO]]
CHECK-NEXT: DW_TAG_subprogram
CHECK: mc:debug_line   llvmcas:// 
CHECK-NEXT: mc:debug_line   llvmcas:// 
CHECK-NEXT: mc:debug_line   llvmcas://[[LINETABLECASID]]
CHECK-NEXT: mc:debug_line   llvmcas://

//--- a.ll

; ModuleID = 'a.cpp'
source_filename = "a.cpp"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx13.0.0"

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z3foov() #0 !dbg !10 {
  ret i32 3, !dbg !16
}

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z4foo2v() #0 !dbg !17 {
  ret i32 4, !dbg !18
}

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z3barv() #0 !dbg !19 {
  ret i32 2, !dbg !20
}

!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6}
!llvm.dbg.cu = !{!7}
!llvm.ident = !{!9}

!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 14, i32 0]}
!1 = !{i32 7, !"Dwarf Version", i32 4}
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{i32 1, !"wchar_size", i32 4}
!4 = !{i32 8, !"PIC Level", i32 2}
!5 = !{i32 7, !"uwtable", i32 1}
!6 = !{i32 7, !"frame-pointer", i32 1}
!7 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !8, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None, sysroot: "/Users/somepath", sdk: "MacOSX.sdk")
!8 = !DIFile(filename: "a.cpp", directory: "/Users/shubham/Development/testclang")
!9 = !{!"clang"}
!10 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !11, file: !11, line: 1, type: !12, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !15)
!11 = !DIFile(filename: "./foo.h", directory: "/Users/shubham/Development/testclang")
!12 = !DISubroutineType(types: !13)
!13 = !{!14}
!14 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!15 = !{}
!16 = !DILocation(line: 2, column: 3, scope: !10)
!17 = distinct !DISubprogram(name: "foo2", linkageName: "_Z4foo2v", scope: !11, file: !11, line: 4, type: !12, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !15)
!18 = !DILocation(line: 5, column: 3, scope: !17)
!19 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !8, file: !8, line: 2, type: !12, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !15)
!20 = !DILocation(line: 3, column: 3, scope: !19)


//--- b.ll

; ModuleID = 'b.cpp'
source_filename = "b.cpp"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-macosx13.0.0"

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z3bazv() #0 !dbg !10 {
  ret i32 1, !dbg !15
}

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z3foov() #0 !dbg !16 {
  ret i32 3, !dbg !18
}

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z4foo2v() #0 !dbg !19 {
  ret i32 4, !dbg !20
}

; Function Attrs: noinline nounwind optnone ssp uwtable(sync)
define i32 @_Z3barv() #0 !dbg !21 {
  ret i32 2, !dbg !22
}

!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6}
!llvm.dbg.cu = !{!7}
!llvm.ident = !{!9}

!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 14, i32 0]}
!1 = !{i32 7, !"Dwarf Version", i32 4}
!2 = !{i32 2, !"Debug Info Version", i32 3}
!3 = !{i32 1, !"wchar_size", i32 4}
!4 = !{i32 8, !"PIC Level", i32 2}
!5 = !{i32 7, !"uwtable", i32 1}
!6 = !{i32 7, !"frame-pointer", i32 1}
!7 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !8, producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None, sysroot: "/Users/somepath", sdk: "MacOSX.some.sdk")
!8 = !DIFile(filename: "b.cpp", directory: "/Users/shubham/Development/testclang")
!9 = !{!"clang"}
!10 = distinct !DISubprogram(name: "baz", linkageName: "_Z3bazv", scope: !8, file: !8, line: 1, type: !11, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !14)
!11 = !DISubroutineType(types: !12)
!12 = !{!13}
!13 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!14 = !{}
!15 = !DILocation(line: 2, column: 5, scope: !10)
!16 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !17, file: !17, line: 1, type: !11, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !14)
!17 = !DIFile(filename: "./foo.h", directory: "/Users/shubham/Development/testclang")
!18 = !DILocation(line: 2, column: 3, scope: !16)
!19 = distinct !DISubprogram(name: "foo2", linkageName: "_Z4foo2v", scope: !17, file: !17, line: 4, type: !11, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !14)
!20 = !DILocation(line: 5, column: 3, scope: !19)
!21 = distinct !DISubprogram(name: "bar", linkageName: "_Z3barv", scope: !8, file: !8, line: 5, type: !11, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !7, retainedNodes: !14)
!22 = !DILocation(line: 6, column: 5, scope: !21)