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