brintos

brintos / llvm-project-archived public Read only

0
0
Text · 4.6 KiB · 94855b0 Raw
115 lines · plain
1; RUN: llc -dwarf-version=4 -generate-type-units \2; RUN:     -filetype=obj -O0 -mtriple=wasm32-unknown-unknown < %s \3; RUN:     | llvm-dwarfdump -v - | FileCheck %s --check-prefix=SINGLE-44 5; RUN: llc -split-dwarf-file=foo.dwo -split-dwarf-output=%t.dwo \6; RUN:     -dwarf-version=4 -generate-type-units \7; RUN:     -filetype=obj -O0 -mtriple=wasm32-unknown-unknown < %s \8; RUN:     | llvm-dwarfdump -v - | FileCheck %s --check-prefix=O-49; RUN: llvm-dwarfdump -v %t.dwo | FileCheck %s --check-prefix=DWO-410 11; RUN: llc -dwarf-version=5 -generate-type-units \12; RUN:     -filetype=obj -O0 -mtriple= < %s \13; RUN:     | llvm-dwarfdump -v - | FileCheck %s --check-prefix=SINGLE-514 15; RUN: llc -split-dwarf-file=foo.dwo \16; RUN:     -dwarf-version=5 -generate-type-units \17; RUN:     -filetype=obj -O0 -mtriple= < %s \18; RUN:     | llvm-dwarfdump -v - | FileCheck %s --check-prefix=O-519 20; This test is derived from test/CodeGen/X86/dwarf-headers.ll21 22; Looking for DWARF headers to be generated correctly.23; There are 8 variants with 5 formats: v4 CU, v4 TU, v5 normal/partial CU,24; v5 skeleton/split CU, v5 normal/split TU.  Some v5 variants differ only25; in the unit_type code, and the skeleton/split CU differs from normal/partial26; by having one extra field (dwo_id).27; (v2 thru v4 CUs are all the same, and TUs were invented in v4,28; so we don't bother checking older versions.)29 30; Test case built from:31;struct S {32;  int s1;33;};34;35;S s;36 37; Verify the v4 non-split headers.38; Note that we check the exact offset of the DIEs because that tells us39; the length of the header.40;41; SINGLE-4: .debug_info contents:42; SINGLE-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004, abbr_offset43; SINGLE-4: 0x0000000b: DW_TAG_compile_unit44;45; SINGLE-4: .debug_types contents:46; SINGLE-4: 0x00000000: Type Unit: {{.*}} version = 0x0004, abbr_offset47; SINGLE-4: 0x00000017: DW_TAG_type_unit48 49; Verify the v4 split headers.50;51; O-4: .debug_info contents:52; O-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004, abbr_offset53; O-4: 0x0000000b: DW_TAG_compile_unit54;55; DWO-4: .debug_info.dwo contents:56; DWO-4: 0x00000000: Compile Unit: {{.*}} version = 0x0004, abbr_offset57; DWO-4: 0x0000000b: DW_TAG_compile_unit58;59; DWO-4: .debug_types.dwo contents:60; DWO-4: 0x00000000: Type Unit: {{.*}} version = 0x0004, abbr_offset61; DWO-4: 0x00000017: DW_TAG_type_unit62 63; Verify the v5 non-split headers. Type units come first.64; All .debug_info sections are reported in one go, but the offset resets for65; each new section.66;67; SINGLE-5: .debug_info contents:68; SINGLE-5: 0x00000000: Type Unit: {{.*}} version = 0x0005, unit_type = DW_UT_type, abbr_offset69; SINGLE-5: 0x00000018: DW_TAG_type_unit70; SINGLE-5-NOT: contents:71; SINGLE-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_compile, abbr_offset72; SINGLE-5: 0x0000000c: DW_TAG_compile_unit73 74; Verify the v5 split headers.75;76; O-5: .debug_info contents:77; O-5: 0x00000000: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_skeleton, abbr_offset78; O-5-SAME:        DWO_id = [[HASH:0x[0-9a-f]*]]79; O-5: 0x00000014: DW_TAG_skeleton_unit80;81; O-5: .debug_info.dwo contents:82; O-5: 0x00000000: Type Unit: {{.*}} version = 0x0005, unit_type = DW_UT_split_type, abbr_offset83; O-5: 0x00000018: DW_TAG_type_unit84; O-5: 0x00000035: Compile Unit: {{.*}} version = 0x0005, unit_type = DW_UT_split_compile, abbr_offset85; O-5-SAME:        DWO_id = [[HASH]]86; O-5: 0x00000049: DW_TAG_compile_unit87 88 89; ModuleID = 't.cpp'90source_filename = "t.cpp"91target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128"92target triple = "wasm32-unknown-unknown-wasm"93 94%struct.S = type { i32 }95 96@s = global %struct.S zeroinitializer, align 4, !dbg !097 98!llvm.dbg.cu = !{!2}99!llvm.module.flags = !{!10, !11}100!llvm.ident = !{!12}101 102!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())103!1 = distinct !DIGlobalVariable(name: "s", scope: !2, file: !3, line: 5, type: !6, isLocal: false, isDefinition: true)104!2 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 5.0.0 (trunk 295942)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)105!3 = !DIFile(filename: "t.cpp", directory: "/home/probinson/projects/scratch")106!4 = !{}107!5 = !{!0}108!6 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "S", file: !3, line: 1, size: 32, elements: !7, identifier: "_ZTS1S")109!7 = !{!8}110!8 = !DIDerivedType(tag: DW_TAG_member, name: "s1", scope: !6, file: !3, line: 2, baseType: !9, size: 32)111!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)112!10 = !{i32 2, !"Dwarf Version", i32 4}113!11 = !{i32 2, !"Debug Info Version", i32 3}114!12 = !{!"clang version 5.0.0 (trunk 295942)"}115