1 # Verifies that llvm-bolt updates CFI correctly after
2 # shrink-wrapping when optimizing a function without
5 # This test has commands that rely on shell capabilities that won't execute
6 # correctly on Windows e.g. subshell execution to capture command output.
9 RUN: %clangxx %cxxflags -no-pie %S/Inputs/exc4sw.S -o %t.exe -Wl,-q
10 RUN: llvm-bolt %t.exe -o %t --relocs --frame-opt=all \
11 RUN: --data=%p/Inputs/exc4sw.fdata --reorder-blocks=cache 2>&1 | \
12 RUN: FileCheck %s --check-prefix=CHECK-BOLT
14 RUN: llvm-objdump --dwarf=frames %t.exe | grep -A20 -e \
15 RUN: `llvm-nm --numeric-sort %t.exe | grep main | tail -n 1 | \
16 RUN: cut -f1 -d' ' | tail -c9` 2>&1 | FileCheck %s --check-prefix=CHECK-INPUT
18 RUN: llvm-objdump --dwarf=frames %t | grep -A20 -e \
19 RUN: `llvm-nm --numeric-sort %t | grep main | tail -n 1 | cut -f1 -d' ' | \
20 RUN: tail -c9` 2>&1 | FileCheck %s --check-prefix=CHECK-OUTPUT
22 CHECK-BOLT: Shrink wrapping moved 2 spills inserting load/stores and 0 spills inserting push/pops
24 CHECK-INPUT: DW_CFA_advance_loc: 2
25 CHECK-INPUT-NEXT: DW_CFA_def_cfa_offset: +16
26 CHECK-INPUT-NEXT: DW_CFA_offset: reg13 -16
27 CHECK-INPUT-NEXT: DW_CFA_advance_loc: 2
28 CHECK-INPUT-NEXT: DW_CFA_def_cfa_offset: +24
29 CHECK-INPUT-NEXT: DW_CFA_offset: reg12 -24
30 CHECK-INPUT-NEXT: DW_CFA_advance_loc: 1
31 CHECK-INPUT-NEXT: DW_CFA_def_cfa_offset: +32
32 CHECK-INPUT-NEXT: DW_CFA_offset: reg6 -32
33 CHECK-INPUT-NEXT: DW_CFA_advance_loc: 6
34 CHECK-INPUT-NEXT: DW_CFA_def_cfa_offset: +40
35 CHECK-INPUT-NEXT: DW_CFA_offset: reg3 -40
36 CHECK-INPUT-NEXT: DW_CFA_advance_loc: 6
37 CHECK-INPUT-NEXT: DW_CFA_def_cfa_offset: +48
39 CHECK-OUTPUT: DW_CFA_advance_loc: 4
40 CHECK-OUTPUT-NEXT: DW_CFA_def_cfa_offset: +16
41 CHECK-OUTPUT-NEXT: DW_CFA_def_cfa_offset: +24
42 CHECK-OUTPUT-NEXT: DW_CFA_advance_loc: 1
43 CHECK-OUTPUT-NEXT: DW_CFA_def_cfa_offset: +32
44 CHECK-OUTPUT-NEXT: DW_CFA_offset: reg6 -32
45 CHECK-OUTPUT-NEXT: DW_CFA_advance_loc: 6
46 CHECK-OUTPUT-NEXT: DW_CFA_def_cfa_offset: +40
47 CHECK-OUTPUT-NEXT: DW_CFA_offset: reg3 -40
48 CHECK-OUTPUT-NEXT: DW_CFA_advance_loc: 6
49 CHECK-OUTPUT-NEXT: DW_CFA_def_cfa_offset: +48