1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
|
RUN: llc -filetype=obj %p/Inputs/debuginfo1.ll -o %t.debuginfo1.o
RUN: llc -filetype=obj %p/Inputs/debuginfo2.ll -o %t.debuginfo2.o
RUN: wasm-ld -o %t.wasm %t.debuginfo1.o %t.debuginfo2.o
RUN: llvm-dwarfdump %t.wasm | FileCheck %s
CHECK: file format WASM
CHECK: .debug_info contents:
CHECK: DW_TAG_compile_unit
CHECK-NEXT: DW_AT_producer ("clang version 7.0.0 (trunk {{.*}})")
CHECK-NEXT: DW_AT_language (DW_LANG_C99)
CHECK-NEXT: DW_AT_name ("hi.c")
CHECK: DW_TAG_subprogram
CHECK-NEXT: DW_AT_low_pc
CHECK-NEXT: DW_AT_high_pc
CHECK-NEXT: DW_AT_frame_base
CHECK-NEXT: DW_AT_name ("test")
CHECK-NEXT: DW_AT_decl_file ("/Users/yury/llvmwasm{{(/|\\)}}hi.c")
CHECK-NEXT: DW_AT_decl_line (3)
CHECK-NEXT: DW_AT_prototyped (true)
CHECK: DW_TAG_formal_parameter
CHECK-NEXT: DW_AT_location (DW_OP_WASM_location 0x0 0x0, DW_OP_stack_value)
CHECK-NEXT: DW_AT_name ("t")
CHECK-NEXT: DW_AT_decl_file ("/Users/yury/llvmwasm{{(/|\\)}}hi.c")
CHECK-NEXT: DW_AT_decl_line (3)
CHECK: DW_TAG_subprogram
CHECK-NEXT: DW_AT_low_pc
CHECK-NEXT: DW_AT_high_pc
CHECK-NEXT: DW_AT_frame_base
CHECK-NEXT: DW_AT_name ("_start")
CHECK-NEXT: DW_AT_decl_file ("/Users/yury/llvmwasm{{(/|\\)}}hi.c")
CHECK-NEXT: DW_AT_decl_line (7)
CHECK: DW_TAG_base_type
CHECK-NEXT: DW_AT_name ("int")
CHECK-NEXT: DW_AT_encoding (DW_ATE_signed)
CHECK-NEXT: DW_AT_byte_size (0x04)
CHECK: DW_TAG_compile_unit
CHECK-NEXT: DW_AT_producer ("clang version 7.0.0 (trunk {{.*}})")
CHECK-NEXT: DW_AT_language (DW_LANG_C99)
CHECK-NEXT: DW_AT_name ("hi_foo.c")
CHECK: DW_TAG_variable
CHECK-NEXT: DW_AT_name ("y")
CHECK-NEXT: DW_AT_type (0x000000ac "int[2]")
CHECK-NEXT: DW_AT_external (true)
CHECK-NEXT: DW_AT_decl_file ("{{.*}}hi_foo.c")
CHECK-NEXT: DW_AT_decl_line (1)
CHECK: DW_AT_location (DW_OP_addr 0x400)
CHECK: DW_TAG_array_type
CHECK: DW_TAG_subrange_type
CHECK: DW_TAG_base_type
CHECK-NEXT: DW_AT_name ("int")
CHECK-NEXT: DW_AT_encoding (DW_ATE_signed)
CHECK-NEXT: DW_AT_byte_size (0x04)
CHECK: DW_TAG_base_type
CHECK-NEXT: DW_AT_name ("__ARRAY_SIZE_TYPE__")
CHECK-NEXT: DW_AT_byte_size (0x08)
CHECK-NEXT: DW_AT_encoding (DW_ATE_unsigned)
CHECK: DW_TAG_variable
CHECK-NEXT: DW_AT_name ("z")
CHECK-NEXT: DW_AT_type (0x000000ac "int[2]")
CHECK-NEXT: DW_AT_external (true)
CHECK-NEXT: DW_AT_decl_file ("{{.*}}hi_foo.c")
CHECK-NEXT: DW_AT_decl_line (8)
CHECK-NEXT: DW_AT_location (DW_OP_addr 0xffffffff)
CHECK: DW_TAG_subprogram
CHECK-NEXT: DW_AT_low_pc
CHECK-NEXT: DW_AT_high_pc
CHECK-NEXT: DW_AT_frame_base
CHECK-NEXT: DW_AT_name ("foo")
CHECK-NEXT: DW_AT_decl_file ("{{.*}}hi_foo.c")
CHECK-NEXT: DW_AT_decl_line (3)
CHECK: DW_TAG_formal_parameter
CHECK-NEXT: DW_AT_location (DW_OP_WASM_location 0x0 0x0, DW_OP_stack_value)
CHECK-NEXT: DW_AT_name ("p")
CHECK-NEXT: DW_AT_decl_file ("{{.*}}hi_foo.c")
CHECK-NEXT: DW_AT_decl_line (3)
|