File: split-dwarf.test

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (50 lines) | stat: -rw-r--r-- 2,204 bytes parent folder | download | duplicates (13)
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
; RUN: rm -rf %t
; RUN: mkdir -p %t
; RUN: cd %t

; RUN: echo -e "0\n0" > %t.prof

; Test -gsplit-dwarf=single
; RUN: cp %S/Inputs/split-dwarf-single.exe %t/split-dwarf-single.exe
; RUN: yaml2obj %S/Inputs/split-dwarf-single.o.yaml -o %t/split-dwarf-single.o
; RUN: llvm-profgen --format=text --unsymbolized-profile=%t.prof --binary=%t/split-dwarf-single.exe --output=%t1 --fill-zero-for-all-funcs
; RUN: FileCheck %s --input-file %t1 --check-prefix=CHECK-SPLIT-DWARF

; Test -gsplit-dwarf=split
; RUN: cp %S/Inputs/split-dwarf-split.exe %t/split-dwarf-split.exe
; RUN: yaml2obj %S/Inputs/split-dwarf-split.dwo.yaml -o %t/split-dwarf-split.dwo
; RUN: llvm-profgen --format=text --unsymbolized-profile=%t.prof --binary=%t/split-dwarf-split.exe --output=%t2 --fill-zero-for-all-funcs
; RUN: FileCheck %s --input-file %t2 --check-prefix=CHECK-SPLIT-DWARF
; Test --dwp
; RUN: llvm-dwp %t/split-dwarf-split.dwo -o %t/split-dwarf-split.dwp
; RUN: llvm-profgen --format=text --unsymbolized-profile=%t.prof --dwp=%t/split-dwarf-split.dwp --binary=%t/split-dwarf-split.exe --output=%t3 --fill-zero-for-all-funcs
; RUN: FileCheck %s --input-file %t3 --check-prefix=CHECK-SPLIT-DWARF

; Make sure that all function ranges are well retrieved and have been populated with zero.

; CHECK-SPLIT-DWARF:       foo:0:0
; CHECK-SPLIT-DWARF-NEXT:   0: 0
; CHECK-SPLIT-DWARF-NEXT:   1: 0
; CHECK-SPLIT-DWARF-NEXT:  main:0:0
; CHECK-SPLIT-DWARF-NEXT:   0: 0
; CHECK-SPLIT-DWARF-NEXT:   1: 0
; CHECK-SPLIT-DWARF-NEXT:   2: 0


; Build instructions:
; split-dwarf-single.o:       clang -gsplit-dwarf=single -fdebug-compilation-dir=.  test.c   -fdebug-info-for-profiling  -O0 -g -o split-dwarf-single.o -c
; split-dwarf-single.exe:     clang -fdebug-compilation-dir=.  split-dwarf-single.o -o split-dwarf-single.exe  -fdebug-info-for-profiling  -O0 -g

; split-dwarf-split.dwo:      clang -gsplit-dwarf=split -fdebug-compilation-dir=.  test.c  -fdebug-info-for-profiling  -O0 -g -o split-dwarf-split.o -c
; split-dwarf-split.exe:      clang -fdebug-compilation-dir=.  split-dwarf-split.o -o split-dwarf-split.exe  -fdebug-info-for-profiling  -O0 -g

; Source code:

int foo() {
  return 1;
}

int main() {
  foo();
  return 0;
}