Skip to content

Commit 7d5fcb9

Browse files
author
Wael Yehia
committed
[PGO] Use fprofile-continuous in compiler-rt tests
1 parent 7ae78a6 commit 7d5fcb9

File tree

11 files changed

+28
-29
lines changed

11 files changed

+28
-29
lines changed

compiler-rt/test/profile/ContinuousSyncMode/basic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// REQUIRES: continuous-mode
22

3-
// RUN: %clang_profgen_cont -fcoverage-mapping -o %t.exe %s
3+
// RUN: %clang_profgen=%t.profraw -fprofile-continuous -fcoverage-mapping -o %t.exe %s
44
// RUN: echo "garbage" > %t.profraw
5-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
5+
// RUN: %run %t.exe
66
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s -check-prefix=CHECK-COUNTS
77
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
88
//

compiler-rt/test/profile/ContinuousSyncMode/get-filename.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: continuous-mode
22

3-
// RUN: %clang_pgogen_cont -o %t.exe %s
3+
// RUN: %clang_pgogen -fprofile-continuous -o %t.exe %s
44
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe %t.profraw
55
// RUN: env LLVM_PROFILE_FILE="%t%c.profraw" %run %t.exe %t.profraw
66
// RUN: env LLVM_PROFILE_FILE="%t.profraw%c" %run %t.exe %t.profraw

compiler-rt/test/profile/ContinuousSyncMode/image-with-mcdc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// REQUIRES: continuous-mode
22

3-
// RUN: %clang_profgen_cont -fcoverage-mapping -fcoverage-mcdc -O3 -o %t.exe %s
4-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 3 3
3+
// RUN: %clang_profgen=%t.profraw -fprofile-continuous -fcoverage-mapping -fcoverage-mcdc -O3 -o %t.exe %s
4+
// RUN: %run %t.exe 3 3
55
// RUN: llvm-profdata show --text --all-functions %t.profraw | FileCheck %s
66

77
// CHECK: Num Bitmap Bytes:

compiler-rt/test/profile/ContinuousSyncMode/image-with-no-counters.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// REQUIRES: target={{.*(darwin|aix).*}}
22

33
// RUN: echo "static void dead_code(void) {}" > %t.dso.c
4-
// RUN: %clang_profgen_cont -fcoverage-mapping -O3 %shared_lib_flag -o %t.dso.dylib %t.dso.c
5-
// RUN: %clang_profgen_cont -fcoverage-mapping -O3 -o %t.exe %s %t.dso.dylib
6-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe 2>&1 | count 0
4+
// RUN: %clang_profgen=%t.profraw -fprofile-continuous -fcoverage-mapping -O3 %shared_lib_flag -o %t.dso.dylib %t.dso.c
5+
// RUN: %clang_profgen=%t.profraw -fprofile-continuous -fcoverage-mapping -O3 -o %t.exe %s %t.dso.dylib
6+
// RUN: %run %t.exe 2>&1 | count 0
77
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s
88

99
// CHECK: Total functions: 1

compiler-rt/test/profile/ContinuousSyncMode/multi-threaded.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// REQUIRES: continuous-mode
22

3-
// RUN: rm -f %t.profraw
4-
// RUN: %clangxx_pgogen_cont -lpthread %s -o %t.exe -mllvm -disable-vp -fprofile-update=atomic
5-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
6-
// RUN: llvm-profdata show --counts --function=accum %t.profraw | FileCheck %s
3+
// RUN: rm -rf %t.dir
4+
// RUN: %clangxx_pgogen=%t.dir -fprofile-continuous -lpthread %s -o %t.exe -mllvm -disable-vp -fprofile-update=atomic
5+
// RUN: %run %t.exe
6+
// RUN: llvm-profdata show --counts --function=accum %t.dir/default_*.profraw | FileCheck %s
77
// CHECK: Block counts: [100000, 4]
88

99
#include <thread>

compiler-rt/test/profile/ContinuousSyncMode/online-merging-windows.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
// RUN: rm -rf %t.dir && split-file %s %t.dir && cd %t.dir
1111
//
1212
// Create two DLLs and a driver program that uses them.
13-
// RUN: %clang_pgogen foo.c -mllvm -instrprof-atomic-counter-update-all=1 -mllvm -runtime-counter-relocation=true -fuse-ld=lld -Wl,-dll -o %t.dir/foo.dll
14-
// RUN: %clang_pgogen bar.c -mllvm -instrprof-atomic-counter-update-all=1 -mllvm -runtime-counter-relocation=true -fuse-ld=lld -Wl,-dll -o %t.dir/bar.dll
15-
// RUN: %clang_pgogen main.c -o main.exe %t.dir/foo.lib %t.dir/bar.lib -mllvm -instrprof-atomic-counter-update-all=1 -mllvm -runtime-counter-relocation=true -fuse-ld=lld
13+
// RUN: %clang_pgogen=%t.dir/profdir -fprofile-continuous -fprofile-update=atomic foo.c -fuse-ld=lld -Wl,-dll -o %t.dir/foo.dll
14+
// RUN: %clang_pgogen=%t.dir/profdir -fprofile-continuous -fprofile-update=atomic bar.c -fuse-ld=lld -Wl,-dll -o %t.dir/bar.dll
15+
// RUN: %clang_pgogen=%t.dir/profdir -fprofile-continuous -fprofile-update=atomic main.c -o main.exe %t.dir/foo.lib %t.dir/bar.lib -fuse-ld=lld
1616
//
1717
// === Round 1 ===
1818
// Test merging+continuous mode without any file contention.
1919
//
20-
// RUN: env LLVM_PROFILE_FILE="%t.dir/profdir/%m%c.profraw" %run %t.dir/main.exe nospawn
20+
// RUN: %run %t.dir/main.exe nospawn
2121
// RUN: llvm-profdata merge -o %t.profdata %t.dir/profdir
2222
// RUN: llvm-profdata show --counts --all-functions %t.profdata | FileCheck %s -check-prefix=ROUND1
2323

@@ -37,7 +37,7 @@
3737
// === Round 2 ===
3838
// Test merging+continuous mode with some file contention.
3939
//
40-
// RUN: env LLVM_PROFILE_FILE="%t.dir/profdir/%m%c.profraw" %run %t.dir/main.exe spawn
40+
// RUN: %run %t.dir/main.exe spawn
4141
// RUN: llvm-profdata merge -o %t.profdata %t.dir/profdir
4242
// RUN: llvm-profdata show --counts --all-functions %t.profdata | FileCheck %s -check-prefix=ROUND2
4343

@@ -157,4 +157,4 @@ int main(int argc, char *const argv[]) {
157157
}
158158

159159
return 1;
160-
}
160+
}

compiler-rt/test/profile/ContinuousSyncMode/online-merging.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
// Create two DSOs and a driver program that uses them.
1010
// RUN: echo "void dso1(void) {}" > dso1.c
1111
// RUN: echo "void dso2(void) {}" > dso2.c
12-
// RUN: %clang_pgogen_cont %shared_lib_flag -o %t.dir/dso1.dylib dso1.c -fprofile-update=atomic
13-
// RUN: %clang_pgogen_cont %shared_lib_flag -o %t.dir/dso2.dylib dso2.c -fprofile-update=atomic
14-
// RUN: %clang_pgogen_cont -o main.exe %s %t.dir/dso1.dylib %t.dir/dso2.dylib -fprofile-update=atomic
12+
// RUN: %clang_pgogen=%t.dir/profdir -fprofile-continuous -fprofile-update=atomic %shared_lib_flag -o %t.dir/dso1.dylib dso1.c
13+
// RUN: %clang_pgogen=%t.dir/profdir -fprofile-continuous -fprofile-update=atomic %shared_lib_flag -o %t.dir/dso2.dylib dso2.c
14+
// RUN: %clang_pgogen=%t.dir/profdir -fprofile-continuous -fprofile-update=atomic -o main.exe %s %t.dir/dso1.dylib %t.dir/dso2.dylib
1515
//
1616
// === Round 1 ===
1717
// Test merging+continuous mode without any file contention.
1818
//
19-
// RUN: env LLVM_PROFILE_FILE="%t.dir/profdir/%m%c.profraw" %run %t.dir/main.exe nospawn
19+
// RUN: %run %t.dir/main.exe nospawn
2020
// RUN: llvm-profdata merge -o %t.profdata %t.dir/profdir
2121
// RUN: llvm-profdata show --counts --all-functions %t.profdata | FileCheck %s -check-prefix=ROUND1
2222

@@ -40,7 +40,7 @@
4040
// === Round 2 ===
4141
// Test merging+continuous mode with some file contention.
4242
//
43-
// RUN: env LLVM_PROFILE_FILE="%t.dir/profdir/%m%c.profraw" %run %t.dir/main.exe spawn 'LLVM_PROFILE_FILE=%t.dir/profdir/%m%c.profraw'
43+
// RUN: %run %t.dir/main.exe spawn 'LLVM_PROFILE_FILE=%t.dir/profdir/%m%c.profraw'
4444
// RUN: llvm-profdata merge -o %t.profdata %t.dir/profdir
4545
// RUN: llvm-profdata show --counts --all-functions %t.profdata | FileCheck %s -check-prefix=ROUND2
4646

compiler-rt/test/profile/ContinuousSyncMode/reset-default-profile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
// Create & cd into a temporary directory.
66
// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
7-
// RUN: %clang -fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation=true -o %t.exe %s
7+
// RUN: %clang_profgen -fprofile-continuous -fcoverage-mapping -o %t.exe %s
88
// RUN: env LLVM_PROFILE_FILE="incorrect-profile-name%m%c%c.profraw" %run %t.exe
99
// RUN: ls -l | FileCheck %s
1010

compiler-rt/test/profile/ContinuousSyncMode/runtime-counter-relocation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// REQUIRES: target={{.*(linux|solaris|windows-msvc|aix).*}}
22

3-
// RUN: %clang -fprofile-instr-generate -fcoverage-mapping -mllvm -runtime-counter-relocation=true -o %t.exe %s
3+
// RUN: %clang_profgen=%t.profraw -fprofile-continuous -fcoverage-mapping -o %t.exe %s
44
// RUN: echo "garbage" > %t.profraw
5-
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe
5+
// RUN: %run %t.exe
66
// RUN: llvm-profdata show --counts --all-functions %t.profraw | FileCheck %s -check-prefix=CHECK-COUNTS
77
// RUN: llvm-profdata merge -o %t.profdata %t.profraw
88
// RUN: %if !target={{.*aix.*}} %{ llvm-cov report %t.exe -instr-profile %t.profdata | FileCheck %s -check-prefix=CHECK-COVERAGE %}

compiler-rt/test/profile/ContinuousSyncMode/set-file-object.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
// Create & cd into a temporary directory.
55
// RUN: rm -rf %t.dir && mkdir -p %t.dir && cd %t.dir
66

7-
// The -mllvm -runtime-counter-relocation=true flag has effect only on linux.
8-
// RUN: %clang -fprofile-instr-generate -fcoverage-mapping -fprofile-update=atomic -mllvm -runtime-counter-relocation=true -o main.exe %s
7+
// RUN: %clang_profgen -fprofile-continuous -fcoverage-mapping -fprofile-update=atomic -o main.exe %s
98

109
// Test continuous mode with __llvm_profile_set_file_object with mergin disabled.
1110
// RUN: env LLVM_PROFILE_FILE="%t.dir/profdir/%c%mprofraw.old" %run %t.dir/main.exe nomerge %t.dir/profdir/profraw.new 2>&1 | FileCheck %s -check-prefix=WARN

compiler-rt/test/profile/ContinuousSyncMode/set-filename.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// REQUIRES: continuous-mode
22

3-
// RUN: %clang_pgogen_cont -o %t.exe %s
3+
// RUN: %clang_pgogen -fprofile-continuous -o %t.exe %s
44
// RUN: env LLVM_PROFILE_FILE="%c%t.profraw" %run %t.exe %t.profraw %t.bad
55

66
#include <string.h>

0 commit comments

Comments
 (0)