1 ## Checking crashes against injected binary functions created by patch
2 ## entries pass and debug info turned on. In these cases, we were
3 ## trying to fetch input to output maps on injected functions and
8 RUN: %clang %cflags -no-pie -g %p/Inputs/patch-entries.c -fuse-ld=lld -o %t.exe \
9 RUN: -Wl,-q -I%p/../Inputs
10 RUN: llvm-bolt -relocs %t.exe -o %t.out --update-debug-sections --force-patch \
13 ## Check that patched functions can be disassembled (override FDE from the
15 # PREAGG: B X:0 #foo.org.0# 1 0
16 RUN: link_fdata %s %t.out %t.preagg PREAGG
17 RUN: perf2bolt %t.out -p %t.preagg --pa -o %t.yaml --profile-format=yaml \
18 RUN: -print-disasm -print-only=foo.org.0/1 2>&1 | FileCheck %s
19 CHECK-NOT: BOLT-WARNING: sizes differ for function foo.org.0/1
20 CHECK: Binary Function "foo.org.0/1(*2)" after disassembly {
22 ## Check the expected eh_frame contents
23 RUN: llvm-nm --print-size %t.out > %t.foo
24 RUN: llvm-objdump %t.out --dwarf=frames >> %t.foo
25 RUN: FileCheck %s --input-file %t.foo --check-prefix=CHECK-FOO
26 CHECK-FOO: 0000000000[[#%x,FOO:]] [[#%x,OPTSIZE:]] t foo
27 CHECK-FOO: 0000000000[[#%x,ORG:]] [[#%x,ORGSIZE:]] t foo.org.0
28 ## patched FDE comes first
29 CHECK-FOO: FDE {{.*}} pc=00[[#%x,ORG]]...00[[#%x,ORG+ORGSIZE]]
30 ## original FDE comes second
31 CHECK-FOO: FDE {{.*}} pc=00[[#%x,ORG]]...00[[#%x,ORG+OPTSIZE]]