Skip to content

Commit d54c62c

Browse files
committed
[profile][test] Add -no-pie to make value profile merge work on Linux with default PIE
Alpine enables PIE by default.
1 parent ef28c78 commit d54c62c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

compiler-rt/test/profile/Linux/instrprof-value-merge-lld.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: lld-available
22
/// Test ld with GC.
33

4-
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -fuse-ld=lld -ffunction-sections -fdata-sections -Wl,--gc-sections -z start-stop-gc
4+
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -no-pie -fuse-ld=lld -ffunction-sections -fdata-sections -Wl,--gc-sections -z start-stop-gc
55
// RUN: rm -rf %t.profdir
66
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
77
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t

compiler-rt/test/profile/Linux/instrprof-value-merge.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c
1+
/// Without PIE function addresses are the same across runs and their value
2+
/// sites can be merged, matching the test.
3+
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -no-pie
24
// RUN: rm -rf %t.profdir
35
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
46
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
@@ -9,7 +11,7 @@
911

1012
/// -z start-stop-gc requires binutils 2.37. Don't test the option for now.
1113
/// TODO: Add -Wl,--gc-sections.
12-
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -fuse-ld=bfd -ffunction-sections -fdata-sections
14+
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -no-pie -fuse-ld=bfd -ffunction-sections -fdata-sections
1315
// RUN: rm -rf %t.profdir
1416
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
1517
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
@@ -18,7 +20,7 @@
1820
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t 1
1921
// RUN: llvm-profdata show -counts -function=main -ic-targets -memop-sizes %t.profdir/default_*.profraw | FileCheck %S/Inputs/instrprof-value-merge.c
2022

21-
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -fuse-ld=gold -ffunction-sections -fdata-sections
23+
// RUN: %clang_pgogen -o %t -O3 %S/Inputs/instrprof-value-merge.c -no-pie -fuse-ld=gold -ffunction-sections -fdata-sections
2224
// RUN: rm -rf %t.profdir
2325
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t
2426
// RUN: env LLVM_PROFILE_FILE=%t.profdir/default_%m.profraw %run %t

0 commit comments

Comments
 (0)