|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py |
| 2 | +; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump --show-form - | FileCheck %s |
| 3 | + |
| 4 | +; CHECK: .debug_info contents: |
| 5 | +; CHECK-NEXT: 0x00000000: Compile Unit: length = 0x0000006e, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x04 (next unit at 0x00000072) |
| 6 | + |
| 7 | +; CHECK: 0x0000000b: DW_TAG_compile_unit |
| 8 | +; CHECK-NEXT: DW_AT_producer [DW_FORM_strp] ("clang version 6.0.0 (trunk 315924) (llvm/trunk 315960)") |
| 9 | +; CHECK-NEXT: DW_AT_language [DW_FORM_data2] (DW_LANG_C99) |
| 10 | +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ("test.c") |
| 11 | +; CHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000) |
| 12 | +; CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ("/usr/local/google/home/sbc/dev/wasm/simple") |
| 13 | +; CHECK-NEXT: DW_AT_GNU_pubnames [DW_FORM_flag_present] (true) |
| 14 | +; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x00000002) |
| 15 | +; CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000002) |
| 16 | + |
| 17 | +; CHECK: 0x00000026: DW_TAG_variable |
| 18 | +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ("foo") |
| 19 | +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (0x00000037 "int*") |
| 20 | +; CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true) |
| 21 | +; CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] ("/usr/local/google/home/sbc/dev/wasm/simple\test.c") |
| 22 | +; CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (4) |
| 23 | +; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x0) |
| 24 | + |
| 25 | +; CHECK: 0x00000037: DW_TAG_pointer_type |
| 26 | +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (0x0000003c "int") |
| 27 | + |
| 28 | +; CHECK: 0x0000003c: DW_TAG_base_type |
| 29 | +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ("int") |
| 30 | +; CHECK-NEXT: DW_AT_encoding [DW_FORM_data1] (DW_ATE_signed) |
| 31 | +; CHECK-NEXT: DW_AT_byte_size [DW_FORM_data1] (0x04) |
| 32 | + |
| 33 | +; CHECK: 0x00000043: DW_TAG_variable |
| 34 | +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ("ptr2") |
| 35 | +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (0x00000054 "void()*") |
| 36 | +; CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true) |
| 37 | +; CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] ("/usr/local/google/home/sbc/dev/wasm/simple\test.c") |
| 38 | +; CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (5) |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | +; TODO: is this correct? |
| 43 | + |
| 44 | +; CHECK-NEXT: DW_AT_location [DW_FORM_exprloc] (DW_OP_addr 0x8) |
| 45 | + |
| 46 | +; CHECK: 0x00000054: DW_TAG_pointer_type |
| 47 | +; CHECK-NEXT: DW_AT_type [DW_FORM_ref4] (0x00000059 "void()") |
| 48 | + |
| 49 | +; CHECK: 0x00000059: DW_TAG_subroutine_type |
| 50 | +; CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true) |
| 51 | + |
| 52 | +; CHECK: 0x0000005a: DW_TAG_subprogram |
| 53 | +; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x00000002) |
| 54 | +; CHECK-NEXT: DW_AT_high_pc [DW_FORM_data4] (0x00000002) |
| 55 | +; CHECK-NEXT: DW_AT_frame_base [DW_FORM_exprloc] (DW_OP_WASM_location 0x3 0x0, DW_OP_stack_value) |
| 56 | +; CHECK-NEXT: DW_AT_name [DW_FORM_strp] ("f2") |
| 57 | +; CHECK-NEXT: DW_AT_decl_file [DW_FORM_data1] ("/usr/local/google/home/sbc/dev/wasm/simple\test.c") |
| 58 | +; CHECK-NEXT: DW_AT_decl_line [DW_FORM_data1] (2) |
| 59 | +; CHECK-NEXT: DW_AT_prototyped [DW_FORM_flag_present] (true) |
| 60 | +; CHECK-NEXT: DW_AT_external [DW_FORM_flag_present] (true) |
| 61 | + |
| 62 | +; CHECK: 0x00000071: NULL |
| 63 | + |
| 64 | +target triple = "wasm64-unknown-unknown" |
| 65 | + |
| 66 | +source_filename = "test.c" |
| 67 | + |
| 68 | +@myextern = external global i32, align 4 |
| 69 | +@foo = hidden global i32* @myextern, align 4, !dbg !0 |
| 70 | +@ptr2 = hidden global void ()* @f2, align 4, !dbg !6 |
| 71 | + |
| 72 | +; Function Attrs: noinline nounwind optnone |
| 73 | +define hidden void @f2() #0 !dbg !17 { |
| 74 | +entry: |
| 75 | + ret void, !dbg !18 |
| 76 | +} |
| 77 | + |
| 78 | +attributes #0 = { noinline nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="generic" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 79 | + |
| 80 | +!llvm.dbg.cu = !{!2} |
| 81 | +!llvm.module.flags = !{!13, !14, !15} |
| 82 | +!llvm.ident = !{!16} |
| 83 | + |
| 84 | +!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) |
| 85 | +!1 = distinct !DIGlobalVariable(name: "foo", scope: !2, file: !3, line: 4, type: !11, isLocal: false, isDefinition: true) |
| 86 | +!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 6.0.0 (trunk 315924) (llvm/trunk 315960)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5) |
| 87 | +!3 = !DIFile(filename: "test.c", directory: "/usr/local/google/home/sbc/dev/wasm/simple") |
| 88 | +!4 = !{} |
| 89 | +!5 = !{!0, !6} |
| 90 | +!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression()) |
| 91 | +!7 = distinct !DIGlobalVariable(name: "ptr2", scope: !2, file: !3, line: 5, type: !8, isLocal: false, isDefinition: true) |
| 92 | +!8 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !9, size: 64) |
| 93 | +!9 = !DISubroutineType(types: !10) |
| 94 | +!10 = !{null} |
| 95 | +!11 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !12, size: 64) |
| 96 | +!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 97 | +!13 = !{i32 2, !"Dwarf Version", i32 4} |
| 98 | +!14 = !{i32 2, !"Debug Info Version", i32 3} |
| 99 | +!15 = !{i32 1, !"wchar_size", i32 4} |
| 100 | +!16 = !{!"clang version 6.0.0 (trunk 315924) (llvm/trunk 315960)"} |
| 101 | +!17 = distinct !DISubprogram(name: "f2", scope: !3, file: !3, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !2, retainedNodes: !4) |
| 102 | +!18 = !DILocation(line: 2, column: 16, scope: !17) |
0 commit comments