• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Test to check if machine function splitter still produces the right backtraces
2# with lldb when a function is split into a hot and cold part and the cold part
3# is executed.  The cold part has the same function symbol name but with a
4# ".cold" suffix and this test checks that the back trace is clear.
5
6# UNSUPPORTED: system-darwin, system-windows
7# REQUIRES: target-x86_64
8# REQUIRES: lld
9
10# RUN: split-file %s %t.split
11#
12# RUN: %clang_host %p/Inputs/split-machine-functions.ll -o %t
13# RUN: %lldb %t -s %t.split/commands -o exit | FileCheck  %s --check-prefix=DEFAULT
14#
15# RUN: %clang_host %p/Inputs/split-machine-functions.ll -fsplit-machine-functions -o %t
16# RUN: %lldb %t -s %t.split/commands -o exit | FileCheck  %s --check-prefix=SPLIT
17#
18# Test a permutation where foo.cold is very far from foo.  The default ordering does not
19# ensure that there will be a gap between foo and foo.cold.  Using a symbol ordering
20# file guarantees this
21# RUN: %clang_host %p/Inputs/split-machine-functions.ll -fsplit-machine-functions -o %t -fuse-ld=lld -Wl,--symbol-ordering-file,%t.split/sym_order_1.txt -Wl,--warn-symbol-ordering -Wl,--fatal-warnings
22# RUN: %lldb %t -s %t.split/commands -o exit | FileCheck  %s --check-prefix=SPLIT
23
24#--- commands
25breakpoint set -n bar
26# DEFAULT: Breakpoint 1: where = {{.*}}`bar
27# SPLIT: Breakpoint 1: where = {{.*}}`bar
28
29process launch
30# DEFAULT: stop reason = breakpoint 1.1
31# SPLIT: stop reason = breakpoint 1.1
32
33thread backtrace
34# DEFAULT: frame #0: {{.*}}`bar
35# DEFAULT: frame #1: {{.*}}`foo() +
36# DEFAULT: frame #2: {{.*}}`main +
37# SPLIT: frame #0: {{.*}}`bar
38# SPLIT: frame #1: {{.*}}`foo() (.cold) +
39# SPLIT: frame #2: {{.*}}`main +
40
41#--- sym_order_1.txt
42_Z3foov
43main
44_Z3barv
45_Z3bazv
46_Z3foov.cold
47