120 lines · plain
1; RUN: llc -split-dwarf-file=baz.dwo -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t2; RUN: llvm-dwarfdump -v -all %t | FileCheck %s3; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s4; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s5 6source_filename = "test/DebugInfo/X86/fission-cu.ll"7 8@a = common global i32 0, align 4, !dbg !09 10!llvm.dbg.cu = !{!4}11!llvm.module.flags = !{!7}12 13!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())14!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)15!2 = !DIFile(filename: "baz.c", directory: "/usr/local/google/home/echristo/tmp")16!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)17!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, runtimeVersion: 0, splitDebugFilename: "baz.dwo", emissionKind: FullDebug, enums: !5, retainedTypes: !5, globals: !6, imports: !5)18!5 = !{}19; Check that the skeleton compile unit contains the proper attributes:20; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,21; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,22; DW_AT_ranges_base, DW_AT_addr_base.23 24; CHECK: .debug_abbrev contents:25; CHECK: Abbrev table for offset: 0x0000000026; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_no27; CHECK: DW_AT_stmt_list DW_FORM_sec_offset28; CHECK: DW_AT_comp_dir DW_FORM_strp29; CHECK: DW_AT_GNU_dwo_name DW_FORM_strp30; CHECK: DW_AT_GNU_dwo_id DW_FORM_data831 32; Check that we're using the right forms.33; CHECK: .debug_abbrev.dwo contents:34; CHECK: Abbrev table for offset: 0x0000000035; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes36; CHECK: DW_AT_producer DW_FORM_GNU_str_index37; CHECK: DW_AT_language DW_FORM_data238; CHECK: DW_AT_name DW_FORM_GNU_str_index39; CHECK: DW_AT_GNU_dwo_name DW_FORM_GNU_str_index40; CHECK-NOT: DW_AT_low_pc41; CHECK-NOT: DW_AT_stmt_list42; CHECK-NOT: DW_AT_comp_dir43; CHECK: DW_AT_GNU_dwo_id DW_FORM_data844 45; CHECK: [2] DW_TAG_variable DW_CHILDREN_no46; CHECK: DW_AT_name DW_FORM_GNU_str_index47; CHECK: DW_AT_type DW_FORM_ref448; CHECK: DW_AT_external DW_FORM_flag_present49; CHECK: DW_AT_decl_file DW_FORM_data150; CHECK: DW_AT_decl_line DW_FORM_data151; CHECK: DW_AT_location DW_FORM_exprloc52 53; CHECK: [3] DW_TAG_base_type DW_CHILDREN_no54; CHECK: DW_AT_name DW_FORM_GNU_str_index55; CHECK: DW_AT_encoding DW_FORM_data156; CHECK: DW_AT_byte_size DW_FORM_data157 58; CHECK: .debug_info contents:59; CHECK: DW_TAG_compile_unit60; CHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)61; CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000000] = "/usr/local/google/home/echristo/tmp")62; CHECK-NEXT: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000024] = "baz.dwo")63; CHECK-NEXT: DW_AT_GNU_dwo_id [DW_FORM_data8] ([[HASH:0x[0-9a-f]*]])64 65; Check that the rest of the compile units have information.66; CHECK: .debug_info.dwo contents:67; CHECK: DW_TAG_compile_unit68; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] (indexed (00000002) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")69; CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)70; CHECK: DW_AT_name [DW_FORM_GNU_str_index] (indexed (00000003) string = "baz.c")71; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] (indexed (00000004) string = "baz.dwo")72; CHECK-NOT: DW_AT_low_pc73; CHECK-NOT: DW_AT_stmt_list74; CHECK-NOT: DW_AT_comp_dir75; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] ([[HASH]])76; CHECK: DW_TAG_variable77; CHECK: DW_AT_name [DW_FORM_GNU_str_index] (indexed (00000000) string = "a")78; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]}79; CHECK: DW_AT_external [DW_FORM_flag_present] (true)80; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)81; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)82; CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_GNU_addr_index 0x0)83; CHECK: [[TYPE]]: DW_TAG_base_type84; CHECK: DW_AT_name [DW_FORM_GNU_str_index] (indexed (00000001) string = "int")85 86; CHECK: .debug_str contents:87; CHECK: 0x00000000: "/usr/local/google/home/echristo/tmp"88; CHECK: 0x00000024: "baz.dwo"89 90; CHECK: .debug_str.dwo contents:91; CHECK: 0x00000000: "a"92; CHECK: 0x00000002: "int"93; CHECK: 0x00000006: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"94; CHECK: 0x0000003b: "baz.c"95; CHECK: 0x00000041: "baz.dwo"96 97; CHECK: .debug_str_offsets.dwo contents:98; CHECK: 0x00000000: 0000000099; CHECK: 0x00000004: 00000002100; CHECK: 0x00000008: 00000006101; CHECK: 0x0000000c: 0000003b102; CHECK: 0x00000010: 00000041103 104; Object file checks105; For x86-64-linux we should have this set of relocations for the debug info section106;107; OBJ: .debug_info108; OBJ-NEXT: R_X86_64_32 .debug_abbrev109; OBJ-NEXT: R_X86_64_32 .debug_line110; OBJ-NEXT: R_X86_64_32 .debug_str111; OBJ-NEXT: R_X86_64_32 .debug_str112; OBJ-NEXT: R_X86_64_32 .debug_addr113; OBJ-NEXT: }114 115; HDR-NOT: .debug_aranges116; HDR-NOT: .rela.{{.*}}.dwo117 118!6 = !{!0}119!7 = !{i32 1, !"Debug Info Version", i32 3}120