104 lines · plain
1; REQUIRES: system-linux2; RUN: llc -O0 --function-sections --generate-arange-section -filetype=obj %s -o %tmain.obj3; RUN: llvm-dwarfdump --debug-info %tmain.obj > %tmain.txt4; RUN: llvm-dwarfdump --debug-aranges %tmain.obj >> %tmain.txt5; RUN: cat %tmain.txt | FileCheck --check-prefix=CHECK %s6 7; CHECK: DW_AT_ranges8; CHECK-NEXT: [0x[[#%.16x,ADDR:]], 0x[[#%.16x,ADDR1:]])9; CHECK-NEXT: [0x[[#%.16x,ADDR2:]], 0x[[#%.16x,ADDR3:]])10; CHECK-NEXT: [0x[[#%.16x,ADDR4:]], 0x[[#%.16x,ADDR5:]])11 12; CHECK: Address Range Header13; CHECK-NEXT: [0x[[#ADDR]], 0x[[#ADDR1]])14; CHECK-NEXT: [0x[[#ADDR2]], 0x[[#ADDR3]])15; CHECK-NEXT: [0x[[#ADDR4]], 0x[[#ADDR5]])16 17; ModuleID = 'example.cpp'18source_filename = "example.cpp"19target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"20target triple = "x86_64-unknown-linux-gnu"21 22%struct.S = type { ptr }23 24@GlobalConst = dso_local global i32 42, align 425@Global = dso_local global i32 0, align 426@s = dso_local global %struct.S zeroinitializer, align 827 28; Function Attrs: alwaysinline mustprogress nounwind uwtable29define dso_local noundef i32 @_Z6squarei(i32 noundef %i) #0 !dbg !10 {30entry:31 %i.addr = alloca i32, align 432 store i32 %i, ptr %i.addr, align 433 %0 = load i32, ptr %i.addr, align 4, !dbg !1334 %1 = load i32, ptr %i.addr, align 4, !dbg !1435 %mul = mul nsw i32 %0, %1, !dbg !1536 ret i32 %mul, !dbg !1637}38 39; Function Attrs: mustprogress noinline nounwind optnone uwtable40define dso_local noundef i32 @_Z4cubei(i32 noundef %i) #1 !dbg !17 {41entry:42 %i.addr.i = alloca i32, align 443 %i.addr = alloca i32, align 444 %squared = alloca i32, align 445 store i32 %i, ptr %i.addr, align 446 %0 = load i32, ptr %i.addr, align 4, !dbg !1847 store i32 %0, ptr %i.addr.i, align 448 %1 = load i32, ptr %i.addr.i, align 4, !dbg !1949 %2 = load i32, ptr %i.addr.i, align 4, !dbg !2150 %mul.i = mul nsw i32 %1, %2, !dbg !2251 store i32 %mul.i, ptr %squared, align 4, !dbg !2352 %3 = load i32, ptr %squared, align 4, !dbg !2453 %4 = load i32, ptr %i.addr, align 4, !dbg !2554 %mul = mul nsw i32 %3, %4, !dbg !2655 ret i32 %mul, !dbg !2756}57 58; Function Attrs: mustprogress noinline norecurse nounwind optnone uwtable59define dso_local noundef i32 @main() #2 !dbg !28 {60entry:61 %retval = alloca i32, align 462 store i32 0, ptr %retval, align 463 ret i32 0, !dbg !2964}65 66attributes #0 = { alwaysinline mustprogress nounwind 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" }67attributes #1 = { 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" }68attributes #2 = { 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" }69 70!llvm.dbg.cu = !{!0}71!llvm.module.flags = !{!2, !3, !4, !5, !6, !7, !8}72!llvm.ident = !{!9}73 74!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 16.0.0 (ssh://git.vip.facebook.com/data/gitrepos/osmeta/external/llvm-project a312c5cce360203b4b24757e1e69738f8b3f2ec1)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, splitDebugInlining: false, nameTableKind: None)75!1 = !DIFile(filename: "example.cpp", directory: "/examples")76!2 = !{i32 7, !"Dwarf Version", i32 4}77!3 = !{i32 2, !"Debug Info Version", i32 3}78!4 = !{i32 1, !"wchar_size", i32 4}79!5 = !{i32 8, !"PIC Level", i32 2}80!6 = !{i32 7, !"PIE Level", i32 2}81!7 = !{i32 7, !"uwtable", i32 2}82!8 = !{i32 7, !"frame-pointer", i32 2}83!9 = !{!"clang version 16.0.0"}84!10 = distinct !DISubprogram(name: "square", scope: !1, file: !1, line: 11, type: !11, scopeLine: 11, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)85!11 = !DISubroutineType(types: !12)86!12 = !{}87!13 = !DILocation(line: 11, column: 59, scope: !10)88!14 = !DILocation(line: 11, column: 63, scope: !10)89!15 = !DILocation(line: 11, column: 61, scope: !10)90!16 = !DILocation(line: 11, column: 52, scope: !10)91!17 = distinct !DISubprogram(name: "cube", scope: !1, file: !1, line: 12, type: !11, scopeLine: 12, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)92!18 = !DILocation(line: 13, column: 24, scope: !17)93!19 = !DILocation(line: 11, column: 59, scope: !10, inlinedAt: !20)94!20 = distinct !DILocation(line: 13, column: 17, scope: !17)95!21 = !DILocation(line: 11, column: 63, scope: !10, inlinedAt: !20)96!22 = !DILocation(line: 11, column: 61, scope: !10, inlinedAt: !20)97!23 = !DILocation(line: 13, column: 7, scope: !17)98!24 = !DILocation(line: 14, column: 10, scope: !17)99!25 = !DILocation(line: 14, column: 18, scope: !17)100!26 = !DILocation(line: 14, column: 17, scope: !17)101!27 = !DILocation(line: 14, column: 3, scope: !17)102!28 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 17, type: !11, scopeLine: 17, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)103!29 = !DILocation(line: 18, column: 3, scope: !28)104