|
1 | | -// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm %s -o - | FileCheck %s |
| 1 | +// RUN: rm -rf %t && split-file %s %t |
2 | 2 |
|
3 | | -// RUN: echo "fun:test1" > %t-func.list |
4 | | -// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-func.list -emit-llvm %s -o - | FileCheck %s --check-prefix=FUNC |
| 3 | +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm %t/main.c -o - | FileCheck %s |
| 4 | +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t/func.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=FUNC |
5 | 5 |
|
6 | | -// RUN: echo "src:%s" | sed -e 's/\\/\\\\/g' > %t-file.list |
7 | | -// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-file.list -emit-llvm %s -o - | FileCheck %s --check-prefix=FILE |
| 6 | +// RUN: echo "src:%t/main.c" | sed -e 's/\\/\\\\/g' > %t-file.list |
| 7 | +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-file.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=FILE |
| 8 | +// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t/section.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=SECTION |
| 9 | +// RUN: %clang_cc1 -fprofile-instrument=sample-coldcov -fprofile-list=%t/cold-func.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=COLDCOV |
| 10 | +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t/exclude.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=EXCLUDE |
| 11 | +// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t/exclude-only.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=EXCLUDE |
8 | 12 |
|
9 | | -// RUN: echo -e "[clang]\nfun:test1\n[llvm]\nfun:test2" > %t-section.list |
10 | | -// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t-section.list -emit-llvm %s -o - | FileCheck %s --check-prefix=SECTION |
| 13 | +//--- func.list |
| 14 | +fun:test1 |
11 | 15 |
|
12 | | -// RUN: echo -e "[coldcov]\nfun:test*\n!fun:test2" > %t-cold-func.list |
13 | | -// RUN: %clang_cc1 -fprofile-instrument=coldcov -fprofile-list=%t-cold-func.list -emit-llvm %s -o - | FileCheck %s --check-prefix=COLDCOV |
| 16 | +//--- section.list |
| 17 | +[clang] |
| 18 | +fun:test1 |
| 19 | +[llvm] |
| 20 | +fun:test2 |
14 | 21 |
|
15 | | -// RUN: echo -e "fun:test*\n!fun:test1" > %t-exclude.list |
16 | | -// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-exclude.list -emit-llvm %s -o - | FileCheck %s --check-prefix=EXCLUDE |
| 22 | +//--- cold-func.list |
| 23 | +[sample-coldcov] |
| 24 | +fun:test* |
| 25 | +!fun:test2 |
17 | 26 |
|
18 | | -// RUN: echo "!fun:test1" > %t-exclude-only.list |
19 | | -// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -fprofile-list=%t-exclude-only.list -emit-llvm %s -o - | FileCheck %s --check-prefix=EXCLUDE |
| 27 | +//--- exclude.list |
| 28 | +fun:test* |
| 29 | +!fun:test1 |
20 | 30 |
|
| 31 | +//--- exclude-only.list |
| 32 | +!fun:test1 |
| 33 | +
|
| 34 | +//--- main.c |
21 | 35 | unsigned i; |
22 | 36 |
|
23 | 37 | // CHECK: test1 |
|
0 commit comments