1## This reproduces a bug where profile collected from perf without LBRs and 2## converted into fdata-no-lbr format is reported to not contain profile for any 3## functions. 4 5# REQUIRES: system-linux 6 7# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown \ 8# RUN: %s -o %t.o 9# RUN: link_fdata --no-lbr %s %t.o %t.fdata 10# RUN: FileCheck %s --input-file %t.fdata --check-prefix=CHECK-FDATA 11# RUN: llvm-strip --strip-unneeded %t.o 12# RUN: %clang %cflags %t.o -o %t.exe -Wl,-q -nostdlib 13# RUN: llvm-bolt %t.exe -o %t.out --data %t.fdata --dyno-stats -nl \ 14# RUN: --print-only=_start 2>&1 | FileCheck %s --check-prefix=CHECK-BOLT 15 16# CHECK-FDATA: no_lbr 17# CHECK-FDATA-NEXT: 1 _start [[#]] 1 18 19# CHECK-BOLT: BOLT-INFO: pre-processing profile using branch profile reader 20# CHECK-BOLT: BOLT-INFO: operating with basic samples profiling data (no LBR). 21# CHECK-BOLT: BOLT-INFO: 1 out of 1 functions in the binary (100.0%) have non-empty execution profile 22 23 .globl _start 24 .type _start, %function 25_start: 26 pushq %rbp 27 movq %rsp, %rbp 28 cmpl $0x0, %eax 29a: 30# FDATA: 1 _start #a# 1 31 je b 32 movl $0x0, %eax 33 jmp c 34b: 35 movl $0x1, %eax 36c: 37 popq %rbp 38 retq 39.size _start, .-_start 40