1; RUN: llc -mtriple=x86_64-pc-linux -filetype=asm -function-sections < %s | \
2; RUN:   FileCheck --check-prefixes=CHECK,DWARF32 --implicit-check-not=loclists_table_base %s
3; RUN: llc -dwarf64 -mtriple=x86_64-pc-linux -filetype=asm -function-sections < %s | \
4; RUN:   FileCheck --check-prefixes=CHECK,DWARF64 --implicit-check-not=loclists_table_base %s
5
6; CHECK:        {{^}}.Lloclists_table_base0:
7; DWARF32-NEXT: .long   .Ldebug_loc0-.Lloclists_table_base0
8; DWARF32-NEXT: .long   .Ldebug_loc1-.Lloclists_table_base0
9; DWARF64-NEXT: .quad   .Ldebug_loc0-.Lloclists_table_base0
10; DWARF64-NEXT: .quad   .Ldebug_loc1-.Lloclists_table_base0
11
12; DWARF32:      .long   .Lloclists_table_base0  # DW_AT_loclists_base
13; DWARF32:      .long   .Lloclists_table_base0  # DW_AT_loclists_base
14; DWARF64:      .quad   .Lloclists_table_base0  # DW_AT_loclists_base
15; DWARF64:      .quad   .Lloclists_table_base0  # DW_AT_loclists_base
16
17; Function Attrs: uwtable
18define dso_local void @_Z2f2v() local_unnamed_addr #0 !dbg !15 {
19entry:
20  tail call void @_Z2f1v(), !dbg !19
21  call void @llvm.dbg.value(metadata i32 3, metadata !17, metadata !DIExpression()), !dbg !20
22  tail call void @_Z2f1v(), !dbg !21
23  ret void, !dbg !22
24}
25declare !dbg !4 dso_local void @_Z2f1v() local_unnamed_addr #1
26; Function Attrs: nounwind readnone speculatable willreturn
27declare void @llvm.dbg.value(metadata, metadata, metadata) #2
28; Function Attrs: uwtable
29define dso_local void @_Z2f3v() local_unnamed_addr #0 !dbg !23 {
30entry:
31  tail call void @_Z2f1v(), !dbg !26
32  call void @llvm.dbg.value(metadata i32 3, metadata !25, metadata !DIExpression()), !dbg !27
33  tail call void @_Z2f1v(), !dbg !28
34  ret void, !dbg !29
35}
36
37attributes #0 = { uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
38attributes #1 = { "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
39attributes #2 = { nounwind readnone speculatable willreturn }
40
41!llvm.dbg.cu = !{!0, !7}
42!llvm.ident = !{!11, !11}
43!llvm.module.flags = !{!12, !13, !14}
44
45!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0 (git@github.com:llvm/llvm-project.git 9b962d83ece841e43fd2823375dc6ddc94c1b178)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)
46!1 = !DIFile(filename: "loc1.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch", checksumkind: CSK_MD5, checksum: "3c96069dc8a3a1e7868038213ed0364a")
47!2 = !{}
48!3 = !{!4}
49!4 = !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !1, file: !1, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
50!5 = !DISubroutineType(types: !6)
51!6 = !{null}
52!7 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !8, producer: "clang version 10.0.0 (git@github.com:llvm/llvm-project.git 9b962d83ece841e43fd2823375dc6ddc94c1b178)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !9, nameTableKind: None)
53!8 = !DIFile(filename: "loc2.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch", checksumkind: CSK_MD5, checksum: "2d309df0c6f5d8ce7264cc7696738fa9")
54!9 = !{!10}
55!10 = !DISubprogram(name: "f1", linkageName: "_Z2f1v", scope: !8, file: !8, line: 1, type: !5, flags: DIFlagPrototyped, spFlags: DISPFlagOptimized, retainedNodes: !2)
56!11 = !{!"clang version 10.0.0 (git@github.com:llvm/llvm-project.git 9b962d83ece841e43fd2823375dc6ddc94c1b178)"}
57!12 = !{i32 7, !"Dwarf Version", i32 5}
58!13 = !{i32 2, !"Debug Info Version", i32 3}
59!14 = !{i32 1, !"wchar_size", i32 4}
60!15 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !5, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !16)
61!16 = !{!17}
62!17 = !DILocalVariable(name: "i", scope: !15, file: !1, line: 3, type: !18)
63!18 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
64!19 = !DILocation(line: 4, column: 3, scope: !15)
65!20 = !DILocation(line: 0, scope: !15)
66!21 = !DILocation(line: 6, column: 3, scope: !15)
67!22 = !DILocation(line: 7, column: 1, scope: !15)
68!23 = distinct !DISubprogram(name: "f3", linkageName: "_Z2f3v", scope: !8, file: !8, line: 2, type: !5, scopeLine: 2, flags: DIFlagPrototyped | DIFlagAllCallsDescribed, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !7, retainedNodes: !24)
69!24 = !{!25}
70!25 = !DILocalVariable(name: "i", scope: !23, file: !8, line: 3, type: !18)
71!26 = !DILocation(line: 4, column: 3, scope: !23)
72!27 = !DILocation(line: 0, scope: !23)
73!28 = !DILocation(line: 6, column: 3, scope: !23)
74!29 = !DILocation(line: 7, column: 1, scope: !23)
75