106 lines · plain
1# RUN: llvm-mc -triple x86_64-pc-linux -filetype=obj %s -o %t2# RUN: llvm-dwarfdump -v %t | FileCheck %s3 4# CHECK: .debug_info contents:5# CHECK: DW_TAG_compile_unit6# CHECK: DW_AT_ranges [DW_FORM_sec_offset] (0x000000007# CHECK-NEXT: [0x0000000000000000, 0x0000000000000001) ".text.foo1"8# CHECK-NEXT: [0x0000000000000000, 0x0000000000000002) ".text.foo2" [4]9# CHECK-NEXT: [0x0000000000000000, 0x0000000000000003) ".text.foo2" [5])10 11# CHECK: .debug_ranges contents:12# CHECK: 00000000 0000000000000000 000000000000000113# CHECK: 00000000 0000000000000000 000000000000000214# CHECK: 00000000 0000000000000000 000000000000000315# CHECK: 00000000 <End of list>16 17# RUN: llvm-dwarfdump %t | FileCheck %s --check-prefix=BRIEF18# BRIEF: DW_TAG_compile_unit19# BRIEF: DW_AT_ranges (0x0000000020# BRIEF-NEXT: [0x0000000000000000, 0x0000000000000001)21# BRIEF-NEXT: [0x0000000000000000, 0x0000000000000002)22# BRIEF-NEXT: [0x0000000000000000, 0x0000000000000003))23 24# RUN: llvm-dwarfdump -diff %t | FileCheck %s --check-prefix=DIFF25# DIFF: DW_TAG_compile_unit26# DIFF-NEXT: DW_AT_producer ()27# DIFF-NEXT: DW_AT_language (DW_LANG_C_plus_plus)28# DIFF-NEXT: DW_AT_name ()29# DIFF-NEXT: DW_AT_stmt_list ()30# DIFF-NEXT: DW_AT_comp_dir ()31# DIFF-NEXT: DW_AT_low_pc ()32# DIFF-NEXT: DW_AT_ranges ()33 34## Asm code for testcase is a reduced and modified output from next35## invocation and source:36# clang test.cpp -S -o test.s -gmlt -ffunction-sections37# test.cpp:38# void foo1() { }39# void foo2() { }40 41.section .text.foo1,"ax",@progbits42.Lfunc_begin0:43 nop44.Lfunc_end0:45 46.section .text.foo2,"ax",@progbits, unique, 147.Lfunc_begin1:48 nop49 nop50.Lfunc_end1:51 52.section .text.foo2,"ax",@progbits, unique, 253.Lfunc_begin2:54 nop55 nop56 nop57.Lfunc_end2:58 59.section .debug_abbrev,"",@progbits60.byte 1 # Abbreviation Code61.byte 17 # DW_TAG_compile_unit62.byte 0 # DW_CHILDREN_no63.byte 37 # DW_AT_producer64.byte 14 # DW_FORM_strp65.byte 19 # DW_AT_language66.byte 5 # DW_FORM_data267.byte 3 # DW_AT_name68.byte 14 # DW_FORM_strp69.byte 16 # DW_AT_stmt_list70.byte 23 # DW_FORM_sec_offset71.byte 27 # DW_AT_comp_dir72.byte 14 # DW_FORM_strp73.byte 17 # DW_AT_low_pc74.byte 1 # DW_FORM_addr75.byte 85 # DW_AT_ranges76.byte 23 # DW_FORM_sec_offset77.byte 0 # EOM(1)78.byte 0 # EOM(2)79.byte 0 # EOM(3)80 81.section .debug_info,"",@progbits82.Lcu_begin0:83.long 38 # Length of Unit84.short 4 # DWARF version number85.long .debug_abbrev # Offset Into Abbrev. Section86.byte 8 # Address Size (in bytes)87.byte 1 # Abbrev [1] 0xb:0x1f DW_TAG_compile_unit88.long 0 # DW_AT_producer89.short 4 # DW_AT_language90.long 0 # DW_AT_name91.long 0 # DW_AT_stmt_list92.long 0 # DW_AT_comp_dir93.quad 0 # DW_AT_low_pc94.long .Ldebug_ranges0 # DW_AT_ranges95 96.section .debug_ranges,"",@progbits97.Ldebug_ranges0:98.quad .Lfunc_begin099.quad .Lfunc_end0100.quad .Lfunc_begin1101.quad .Lfunc_end1102.quad .Lfunc_begin2103.quad .Lfunc_end2104.quad 0105.quad 0106