xref: /llvm-project/llvm/test/tools/llvm-symbolizer/output-style-inlined.test (revision f5ded4eaa4faafddbe60e7fc3867ce86fb197dbe)
1This test checks that when inlined frames are not shown (--no-inlines) and the output
2style is set to GNU (--output-style=GNU) the name of an inlined function is not
3replaced with the name of the top caller function. At the same time, the current
4behavior of llvm-symbolizer is preserved with --output-style=LLVM or when
5the option is not specified.
6
7RUN: llvm-symbolizer --no-inlines -e %p/Inputs/addr.exe 0x40054d \
8RUN:   | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo
9## Before 2020-08-04, asan_symbolize.py passed --inlining=false if 'symbolize_inline_frames'
10## is set to false. Support this compatibility alias for a while.
11RUN: llvm-symbolizer --inlining=false -e %p/Inputs/addr.exe 0x40054d \
12RUN:   | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo
13
14RUN: llvm-symbolizer --output-style=LLVM --no-inlines -e %p/Inputs/addr.exe 0x40054d \
15RUN:   | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo
16
17RUN: llvm-symbolizer --output-style=GNU --no-inlines -e %p/Inputs/addr.exe 0x40054d \
18RUN:   | FileCheck %s --check-prefix=GNU --implicit-check-not=main
19
20RUN: llvm-addr2line -f -e %p/Inputs/addr.exe 0x40054d \
21RUN:   | FileCheck %s --check-prefix=GNU --implicit-check-not=main
22
23RUN: llvm-addr2line --output-style=GNU -f -e %p/Inputs/addr.exe 0x40054d \
24RUN:   | FileCheck %s --check-prefix=GNU --implicit-check-not=main
25
26RUN: llvm-addr2line --output-style=LLVM -f -e %p/Inputs/addr.exe 0x40054d \
27RUN:   | FileCheck %s --check-prefix=LLVM --implicit-check-not=inctwo
28
29LLVM: main
30GNU: inctwo
31
32## Check that we are able to produce an output properly when the --no-inlines option
33## is specified, but a file doesn't exist. Check we report an error.
34
35RUN: not llvm-symbolizer --output-style=GNU --obj=%p/Inputs/not.exist 0x1 0x2 --no-inlines 2>&1 \
36RUN:   | FileCheck %s --check-prefix=NOT-EXIST -DMSG=%errc_ENOENT
37RUN: not llvm-symbolizer --output-style=LLVM --obj=%p/Inputs/not.exist 0x1 0x2 --no-inlines 2>&1 \
38RUN:   | FileCheck %s --check-prefix=NOT-EXIST -DMSG=%errc_ENOENT
39
40NOT-EXIST: llvm-symbolizer{{.*}}: error: '{{.*}}Inputs/not.exist': [[MSG]]
41