3 ; In-memory debug-object contains some basic DWARF
5 ; RUN: lli --jit-kind=orc-lazy --per-module-lazy --jit-linker=rtdyld \
6 ; RUN: --generate=__dump_jit_debug_objects %s | llvm-dwarfdump --diff - | FileCheck %s
8 ; RUN: lli --jit-kind=orc-lazy --per-module-lazy --jit-linker=jitlink \
9 ; RUN: --generate=__dump_jit_debug_objects %s | llvm-dwarfdump --diff - | FileCheck %s
11 ; CHECK: -: file format elf64-x86-64
12 ; CHECK: .debug_info contents:
13 ; CHECK: 0x00000000: Compile Unit: length = 0x00000047, format = DWARF32, version = 0x0004, abbr_offset = 0x0000, addr_size = 0x08 (next unit at 0x0000004b)
14 ; CHECK: DW_TAG_compile_unit
15 ; CHECK: DW_AT_producer ("compiler version")
16 ; CHECK: DW_AT_language (DW_LANG_C99)
17 ; CHECK: DW_AT_name ("source-file.c")
18 ; CHECK: DW_AT_stmt_list ()
19 ; CHECK: DW_AT_comp_dir ("/workspace")
20 ; CHECK: DW_AT_low_pc ()
21 ; CHECK: DW_AT_high_pc ()
22 ; CHECK: DW_TAG_subprogram
23 ; CHECK: DW_AT_low_pc ()
24 ; CHECK: DW_AT_high_pc ()
25 ; CHECK: DW_AT_frame_base (DW_OP_reg7 RSP)
26 ; CHECK: DW_AT_name ("main")
27 ; CHECK: DW_AT_decl_file ("/workspace/source-file.c")
28 ; CHECK: DW_AT_decl_line (4)
29 ; CHECK: DW_AT_type ("int")
30 ; CHECK: DW_AT_external (true)
31 ; CHECK: DW_TAG_base_type
32 ; CHECK: DW_AT_name ("int")
33 ; CHECK: DW_AT_encoding (DW_ATE_signed)
34 ; CHECK: DW_AT_byte_size (0x04)
37 ; Text section of the in-memory debug-object has a non-null load-address
39 ; RUN: lli --jit-kind=orc-lazy --per-module-lazy --jit-linker=rtdyld \
40 ; RUN: --generate=__dump_jit_debug_objects %s | llvm-objdump --section-headers - | \
41 ; RUN: FileCheck --check-prefix=CHECK_LOAD_ADDR %s
43 ; RUN: lli --jit-kind=orc-lazy --per-module-lazy --jit-linker=jitlink \
44 ; RUN: --generate=__dump_jit_debug_objects %s | llvm-objdump --section-headers - | \
45 ; RUN: FileCheck --check-prefix=CHECK_LOAD_ADDR %s
47 ; CHECK_LOAD_ADDR-NOT: {{[0-9]*}} .text {{.*}} 0000000000000000 TEXT
49 target triple = "x86_64-unknown-unknown-elf"
51 ; Built-in symbol provided by the JIT
52 declare void @__dump_jit_debug_objects(i8*)
54 ; Host-process symbol from the GDB JIT interface
55 @__jit_debug_descriptor = external global i8, align 1
57 define i32 @main() !dbg !9 {
58 %1 = alloca i32, align 4
59 store i32 0, i32* %1, align 4
60 call void @__dump_jit_debug_objects(i8* @__jit_debug_descriptor), !dbg !13
64 !llvm.module.flags = !{!0, !1, !2, !3, !4}
68 !0 = !{i32 2, !"SDK Version", [3 x i32] [i32 10, i32 15, i32 6]}
69 !1 = !{i32 7, !"Dwarf Version", i32 4}
70 !2 = !{i32 2, !"Debug Info Version", i32 3}
71 !3 = !{i32 1, !"wchar_size", i32 4}
72 !4 = !{i32 7, !"PIC Level", i32 2}
73 !5 = distinct !DICompileUnit(language: DW_LANG_C99, file: !6, producer: "compiler version", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !7, nameTableKind: None)
74 !6 = !DIFile(filename: "source-file.c", directory: "/workspace")
76 !8 = !{!"compiler version"}
77 !9 = distinct !DISubprogram(name: "main", scope: !6, file: !6, line: 4, type: !10, scopeLine: 4, spFlags: DISPFlagDefinition, unit: !5, retainedNodes: !7)
78 !10 = !DISubroutineType(types: !11)
80 !12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
81 !13 = !DILocation(line: 5, column: 3, scope: !9)
82 !14 = !DILocation(line: 6, column: 3, scope: !9)