Skip to content

[BOLT][test] Add pseudo-probe-split-func.test #139171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: users/aaupov/spr/main.bolttest-add-pseudo-probe-split-functest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions bolt/test/X86/Inputs/pseudo-probe-split-func.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <stdio.h>

int bar(int x, int y) {
if (x % 3) {
return x - y;
}
return x + y;
}

void foo() {
int s, i = 0;
while (i++ < 4000 * 4000)
if (i % 91) s = bar(i, s); else s += 30;
printf("sum is %d\n", s);
}

int main() {
foo();
return 0;
}
12 changes: 12 additions & 0 deletions bolt/test/X86/pseudo-probe-split-func.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## This test checks if pseudo probes are present in split fragments
RUN: %clang %cflags %p/Inputs/pseudo-probe-split-func.c -o %t \
RUN: -O3 -fuse-ld=lld -fpseudo-probe-for-profiling -fno-omit-frame-pointer \
RUN: -mno-omit-leaf-frame-pointer -g -Wl,-q
RUN: llvm-bolt %t -o %t.out -split-functions --split-strategy=all -lite=0
RUN: llvm-profgen --binary=%t.out --perfscript=1 --output=%t.null \
RUN: --show-disassembly-only --show-pseudo-probe | FileCheck %s
CHECK: Disassembly of section .text.cold.3
CHECK: <foo.cold.3>:
CHECK: [Probe]: FUNC: foo Index: 8 Type: Block
CHECK: <main.cold.3>:
CHECK: [Probe]: FUNC: foo Index: 8 Type: Block Inlined: @ main:2
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.