|
1 | 1 | // RUN: clang -O0 -fprofile-instr-generate -fcoverage-mapping \
|
2 |
| -// RUN: %S/Inputs/myprogram.c %S/Inputs/fb.c -o %t.hex |
3 |
| -// RUN: env LLVM_PROFILE_FILE=%t.hex.profraw |
| 2 | +// RUN: %S/Inputs/merge-same-func-bin1.c %S/Inputs/merge-same-func-bin1-2.c -o %t.hex |
4 | 3 | // RUN: %t.hex
|
| 4 | +// RUN: cp default.profraw %t.hex.profraw |
5 | 5 | //
|
6 | 6 | //---------------- build & run the “x86” variant ------------------------------//
|
7 | 7 | // RUN: clang -O0 -fprofile-instr-generate -fcoverage-mapping \
|
8 |
| -// RUN: %S/Inputs/mypg.c %S/Inputs/fb.c -o %t.x86 |
9 |
| -// RUN: env LLVM_PROFILE_FILE=%t.x86.profraw |
| 8 | +// RUN: %S/Inputs/merge-same-func-bin2.c %S/Inputs/merge-same-func-bin1-2.c -o %t.x86 |
10 | 9 | // RUN: %t.x86 || true
|
11 |
| -// |
| 10 | +// RUN: cp default.profraw %t.x86.profraw |
12 | 11 | //---------------- merge the raw profiles ------------------------------------//
|
13 | 12 | // RUN: llvm-profdata merge --object-aware-hashing=%t.x86 %t.x86.profraw \
|
14 | 13 | // RUN: --object-aware-hashing=%t.hex %t.hex.profraw \
|
|
17 | 16 | //---------------- show unified coverage & check -----------------------------//
|
18 | 17 | // RUN: llvm-cov show -instr-profile=%t.profdata --object=%t.x86 --object=%t.hex --merge-binary-coverage | FileCheck %s
|
19 | 18 | //
|
20 |
| -// CHECK-LABEL: {{.*fb\.c}}: |
| 19 | +// CHECK-LABEL: {{.*merge-same-func-bin1-2\.c}}: |
21 | 20 | // CHECK: 1| 1|int foo() { return 0; }
|
22 | 21 | // CHECK: 2| |
|
23 | 22 | // CHECK: 3| 1|int bar() { return 0; }
|
24 | 23 | // CHECK: 4| |
|
25 | 24 | // CHECK: 5| 1|int bun() { return 0; }
|
26 | 25 | //
|
27 |
| -// CHECK-LABEL: {{.*mypg\.c}}: |
28 |
| -// CHECK: 1| 0|int baz() { return 0; } |
29 |
| -// CHECK: 2| 1|int main() { return 1; } |
30 |
| -// |
31 |
| -// CHECK-LABEL: {{.*myprogram\.c}}: |
| 26 | +// CHECK-LABEL: {{.*merge-same-func-bin1\.c}}: |
32 | 27 | // CHECK: 1| |extern int foo();
|
33 | 28 | // CHECK: 2| |extern int bar();
|
34 | 29 | // CHECK: 3| |extern int bun();
|
|
37 | 32 | // CHECK: 6| 1|int main()
|
38 | 33 | // CHECK: 7| 1| return foo() + bar() + bun();
|
39 | 34 | // CHECK: 8| 1|}
|
| 35 | +// |
| 36 | +// CHECK-LABEL: {{.*merge-same-func-bin2\.c}}: |
| 37 | +// CHECK: 1| 0|int baz() { return 0; } |
| 38 | +// CHECK: 2| 1|int main() { return 1; } |
0 commit comments