File: debug-objects.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (62 lines) | stat: -rw-r--r-- 2,636 bytes parent folder | download | duplicates (8)
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
; REQUIRES: native && x86_64-linux

; In-memory debug-objects contain DWARF
;
; RUN: lli --jit-linker=rtdyld  --orc-lazy-debug=jit-debug-objects %s | llvm-dwarfdump --diff - | FileCheck %s
; RUN: lli --jit-linker=jitlink --orc-lazy-debug=jit-debug-objects %s | llvm-dwarfdump --diff - | FileCheck %s
;
; CHECK: -:	file format elf64-x86-64
; TODO: Synthesized Mach-O objects error out with:
;       truncated or malformed object (offset field of section 8 in
;       LC_SEGMENT_64 command 0 extends past the end of the file)
;
; CHECK: .debug_info contents:
; CHECK: format = DWARF32
; CHECK: DW_TAG_compile_unit
; CHECK:               DW_AT_producer	("clang version 18.0.0git")
; CHECK:               DW_AT_language	(DW_LANG_C11)
; CHECK:               DW_AT_name	("source-file.c")
; CHECK:               DW_AT_comp_dir	("/workspace")
; CHECK:   DW_TAG_subprogram
; CHECK:                 DW_AT_frame_base	(DW_OP_reg7 RSP)
; CHECK:                 DW_AT_name	("main")
; CHECK:                 DW_AT_decl_file	("/workspace/source-file.c")
; CHECK:                 DW_AT_decl_line	(1)
; CHECK:                 DW_AT_type	("int")
; CHECK:                 DW_AT_external	(true)
; CHECK:   DW_TAG_base_type
; CHECK:                 DW_AT_name	("int")
; CHECK:                 DW_AT_encoding	(DW_ATE_signed)
; CHECK:                 DW_AT_byte_size	(0x04)
; CHECK:   NULL

; Text section of the in-memory debug-objects have non-null load-address
;
; RUN: lli --jit-linker=rtdyld --orc-lazy-debug=jit-debug-objects %s | \
; RUN:                              llvm-objdump --section-headers - | \
; RUN:                              FileCheck --check-prefix=CHECK_LOAD_ADDR %s
; RUN: lli --jit-linker=jitlink --orc-lazy-debug=jit-debug-objects %s | \
; RUN:                               llvm-objdump --section-headers - | \
; RUN:                               FileCheck --check-prefix=CHECK_LOAD_ADDR %s
;
; CHECK_LOAD_ADDR:      .text
; CHECK_LOAD_ADDR-NOT:  0000000000000000
; CHECK_LOAD_ADDR-SAME: TEXT

define i32 @main() !dbg !3 {
entry:
  ret i32 0, !dbg !8
}

!llvm.module.flags = !{!0}
!llvm.dbg.cu = !{!2}

!0 = !{i32 2, !"Debug Info Version", i32 3}
!1 = !DIFile(filename: "source-file.c", directory: "/workspace")
!2 = distinct !DICompileUnit(language: DW_LANG_C11, file: !1, producer: "clang version 18.0.0git", emissionKind: FullDebug)
!3 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 1, type: !4, scopeLine: 1, unit: !2, retainedNodes: !7)
!4 = !DISubroutineType(types: !5)
!5 = !{!6}
!6 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!7 = !{}
!8 = !DILocation(line: 1, column: 14, scope: !3)