4 ; RUN: llc -split-dwarf-file=foo.dwo -split-dwarf-output=foo.dwo -O0 -mtriple=x86_64-unknown-linux-gnu -filetype=obj %s -o=foo.o
5 ; RUN: %clang %cflags foo.o -o foo.exe
6 ; RUN: llvm-bolt foo.exe -o foo.exe.bolt --update-debug-sections
7 ; RUN: llvm-dwarfdump --debug-info foo.exe | FileCheck -check-prefix=PRE-BOLT %s
8 ; RUN: llvm-dwarfdump --debug-info foo.exe.bolt | FileCheck %s
10 ; This tests checks that DW_AT_GNU_ranges_base is added at the end of the CU.
12 ; PRE-BOLT: DW_AT_GNU_addr_base
13 ; PRE-BOLT-NOT: DW_AT_GNU_ranges_base
15 ; CHECK: DW_AT_GNU_addr_base
16 ; CHECK-NEXT: DW_AT_GNU_ranges_base
26 ; ModuleID = 'main.cpp'
27 source_filename = "main.cpp"
28 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
29 target triple = "x86_64-unknown-linux-gnu"
31 ; Function Attrs: mustprogress noinline nounwind optnone uwtable
32 define dso_local noundef i32 @_Z3foov() #0 !dbg !8 {
37 ; Function Attrs: mustprogress noinline norecurse nounwind optnone uwtable
38 define dso_local noundef i32 @main() #1 !dbg !14 {
40 %retval = alloca i32, align 4
41 store i32 0, i32* %retval, align 4
42 %call = call noundef i32 @_Z3foov(), !dbg !15
43 ret i32 %call, !dbg !16
46 attributes #0 = { mustprogress noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
47 attributes #1 = { mustprogress noinline norecurse nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
50 !llvm.module.flags = !{!2, !3, !4, !5, !6}
53 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang", isOptimized: false, runtimeVersion: 0, splitDebugFilename: "main.dwo", emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: GNU)
54 !1 = !DIFile(filename: "main.cpp", directory: ".")
55 !2 = !{i32 7, !"Dwarf Version", i32 4}
56 !3 = !{i32 2, !"Debug Info Version", i32 3}
57 !4 = !{i32 1, !"wchar_size", i32 4}
58 !5 = !{i32 7, !"uwtable", i32 1}
59 !6 = !{i32 7, !"frame-pointer", i32 2}
61 !8 = distinct !DISubprogram(name: "foo", linkageName: "_Z3foov", scope: !1, file: !1, line: 1, type: !9, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)
62 !9 = !DISubroutineType(types: !10)
64 !11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
66 !13 = !DILocation(line: 2, column: 3, scope: !8)
67 !14 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 5, type: !9, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)
68 !15 = !DILocation(line: 6, column: 10, scope: !14)
69 !16 = !DILocation(line: 6, column: 3, scope: !14)