brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.1 KiB · dcc3fdd Raw
121 lines · plain
1; RUN: llc -split-dwarf-file=baz.dwo -O0 %s -mtriple=x86_64-unknown-windows-msvc -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 6; This test is derived from test/DebugInfo/X86/fission-cu.ll7 8source_filename = "test/DebugInfo/X86/fission-cu.ll"9 10@a = common global i32 0, align 4, !dbg !011 12!llvm.dbg.cu = !{!4}13!llvm.module.flags = !{!7}14 15!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())16!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)17!2 = !DIFile(filename: "baz.c", directory: "e:\\llvm-project\\tmp")18!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)19!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)20!5 = !{}21; Check that the skeleton compile unit contains the proper attributes:22; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,23; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,24; DW_AT_ranges_base, DW_AT_addr_base.25 26; CHECK: .debug_abbrev contents:27; CHECK: Abbrev table for offset: 0x0000000028; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_no29; CHECK: DW_AT_stmt_list DW_FORM_sec_offset30; CHECK: DW_AT_comp_dir  DW_FORM_strp31; CHECK: DW_AT_GNU_dwo_name      DW_FORM_strp32; CHECK: DW_AT_GNU_dwo_id        DW_FORM_data833 34; Check that we're using the right forms.35; CHECK: .debug_abbrev.dwo contents:36; CHECK: Abbrev table for offset: 0x0000000037; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes38; CHECK: DW_AT_producer  DW_FORM_GNU_str_index39; CHECK: DW_AT_language  DW_FORM_data240; CHECK: DW_AT_name      DW_FORM_GNU_str_index41; CHECK: DW_AT_GNU_dwo_name  DW_FORM_GNU_str_index42; CHECK-NOT: DW_AT_low_pc43; CHECK-NOT: DW_AT_stmt_list44; CHECK-NOT: DW_AT_comp_dir45; CHECK: DW_AT_GNU_dwo_id        DW_FORM_data846 47; CHECK: [2] DW_TAG_variable     DW_CHILDREN_no48; CHECK: DW_AT_name      DW_FORM_GNU_str_index49; CHECK: DW_AT_type      DW_FORM_ref450; CHECK: DW_AT_external  DW_FORM_flag_present51; CHECK: DW_AT_decl_file DW_FORM_data152; CHECK: DW_AT_decl_line DW_FORM_data153; CHECK: DW_AT_location  DW_FORM_exprloc54 55; CHECK: [3] DW_TAG_base_type    DW_CHILDREN_no56; CHECK: DW_AT_name      DW_FORM_GNU_str_index57; CHECK: DW_AT_encoding  DW_FORM_data158; CHECK: DW_AT_byte_size DW_FORM_data159 60; CHECK: .debug_info contents:61; CHECK: DW_TAG_compile_unit62; CHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset]   (0x00000000)63; CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp]     ( .debug_str[0x00000000] = "e:\\llvm-project\\tmp")64; CHECK-NEXT: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000014] = "baz.dwo")65; CHECK-NEXT: DW_AT_GNU_dwo_id [DW_FORM_data8]  ([[HASH:0x[0-9a-f]*]])66 67; Check that the rest of the compile units have information.68; CHECK: .debug_info.dwo contents:69; CHECK: DW_TAG_compile_unit70; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] (indexed (00000002) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")71; CHECK: DW_AT_language [DW_FORM_data2]        (DW_LANG_C99)72; CHECK: DW_AT_name [DW_FORM_GNU_str_index]    (indexed (00000003) string = "baz.c")73; CHECK: DW_AT_GNU_dwo_name [DW_FORM_GNU_str_index] (indexed (00000004) string = "baz.dwo")74; CHECK-NOT: DW_AT_low_pc75; CHECK-NOT: DW_AT_stmt_list76; CHECK-NOT: DW_AT_comp_dir77; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8]  ([[HASH]])78; CHECK: DW_TAG_variable79; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     (indexed (00000000) string = "a")80; CHECK: DW_AT_type [DW_FORM_ref4]       (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]}81; CHECK: DW_AT_external [DW_FORM_flag_present]   (true)82; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)83; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)84; CHECK: DW_AT_location [DW_FORM_exprloc] (DW_OP_GNU_addr_index 0x0)85; CHECK: [[TYPE]]: DW_TAG_base_type86; CHECK: DW_AT_name [DW_FORM_GNU_str_index]     (indexed (00000001) string = "int")87 88; CHECK: .debug_str contents:89; CHECK: 0x00000000: "e:\\llvm-project\\tmp"90; CHECK: 0x00000014: "baz.dwo"91 92; CHECK: .debug_str.dwo contents:93; CHECK: 0x00000000: "a"94; CHECK: 0x00000002: "int"95; CHECK: 0x00000006: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"96; CHECK: 0x0000003b: "baz.c"97; CHECK: 0x00000041: "baz.dwo"98 99; CHECK: .debug_str_offsets.dwo contents:100; CHECK: 0x00000000: 00000000101; CHECK: 0x00000004: 00000002102; CHECK: 0x00000008: 00000006103; CHECK: 0x0000000c: 0000003b104; CHECK: 0x00000010: 00000041105 106; Object file checks107; For COFF we should have this set of relocations for the debug info section108;109; OBJ: .debug_info110; OBJ-NEXT: IMAGE_REL_AMD64_SECREL .debug_abbrev (8)111; OBJ-NEXT: IMAGE_REL_AMD64_SECREL .debug_line (28)112; OBJ-NEXT: IMAGE_REL_AMD64_SECREL .debug_str (12)113; OBJ-NEXT: IMAGE_REL_AMD64_SECREL .debug_str (12)114; OBJ-NEXT: IMAGE_REL_AMD64_SECREL .debug_addr (22)115; OBJ-NEXT: }116 117; HDR-NOT: .debug_aranges118 119!6 = !{!0}120!7 = !{i32 1, !"Debug Info Version", i32 3}121