50 lines · plain
1## This reproduces a bug with not processing interprocedural references from2## ignored functions.3 4# REQUIRES: system-linux5 6# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o7# RUN: %clang %cflags %t.o -o %t.exe -nostdlib -Wl,-q8# RUN: llvm-bolt %t.exe -o %t.out --enable-bat -funcs=main9# RUN: link_fdata %s %t.out %t.preagg PREAGG10# RUN: perf2bolt %t.out -p %t.preagg --pa -o %t.fdata -w %t.yaml11# RUN: FileCheck %s --input-file=%t.fdata --check-prefix=CHECK-FDATA12# RUN: FileCheck %s --input-file=%t.yaml --check-prefix=CHECK-YAML13 14# CHECK-FDATA: 1 main 0 1 foo a 1 115# CHECK-YAML: name: main16# CHECK-YAML: calls: {{.*}} disc: 117 18# PREAGG: B #main# #foo_secondary# 1 119## main calls foo at valid instruction offset past nops that are to be stripped.20 .globl main21main:22 .cfi_startproc23 call foo_secondary24 ret25 .cfi_endproc26.size main,.-main27 28## Placeholder cold fragment to force main to be ignored in non-relocation mode.29 .globl main.cold30main.cold:31 .cfi_startproc32 ud233 .cfi_endproc34.size main.cold,.-main.cold35 36## foo is set up to contain a valid instruction at called offset, and trapping37## instructions past that.38 .globl foo39foo:40 .cfi_startproc41 .nops 1042 .globl foo_secondary43foo_secondary:44 ret45 .rept 2046 int347 .endr48 .cfi_endproc49.size foo,.-foo50