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
22
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
55
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
812
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
1115
12- // RUN: echo -e "fun:test*\n!fun:test1" > %t-exclude.list
13- // 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
16+ //--- section.list
17+ [clang ]
18+ fun :test1
19+ [llvm ]
20+ fun :test2
1421
15- // RUN: echo "!fun:test1" > %t-exclude-only.list
16- // 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
22+ //--- cold-func.list
23+ [sample - coldcov ]
24+ fun :test *
25+ !fun :test2
1726
27+ //--- exclude.list
28+ fun :test *
29+ !fun :test1
30+
31+ //--- exclude-only.list
32+ !fun :test1
33+
34+ //--- main.c
1835unsigned i ;
1936
2037// CHECK: test1
@@ -36,6 +53,8 @@ unsigned i;
3653// SECTION: @test1
3754// EXCLUDE: noprofile
3855// EXCLUDE: @test1
56+ // COLDCOV-NOT: noprofile
57+ // COLDCOV: @test1
3958unsigned test1 (void ) {
4059 // CHECK: %pgocount = load i64, ptr @__profc_{{_?}}test1
4160 // FUNC: %pgocount = load i64, ptr @__profc_{{_?}}test1
@@ -55,6 +74,8 @@ unsigned test1(void) {
5574// SECTION: @test2
5675// EXCLUDE-NOT: noprofile
5776// EXCLUDE: @test2
77+ // COLDCOV: noprofile
78+ // COLDCOV: @test2
5879unsigned test2 (void ) {
5980 // CHECK: %pgocount = load i64, ptr @__profc_{{_?}}test2
6081 // FUNC-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test2
0 commit comments