1 // RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm %s -o - | FileCheck %s
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
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
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
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
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
29 // CHECK-NOT: noprofile
31 // FUNC-NOT: noprofile
33 // FILE-NOT: noprofile
39 unsigned test1(void) {
40 // CHECK: %pgocount = load i64, ptr @__profc_{{_?}}test1
41 // FUNC: %pgocount = load i64, ptr @__profc_{{_?}}test1
42 // FILE: %pgocount = load i64, ptr @__profc_{{_?}}test1
43 // SECTION-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test1
44 // EXCLUDE-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test1
48 // CHECK-NOT: noprofile
52 // FILE-NOT: noprofile
54 // SECTION-NOT: noprofile
56 // EXCLUDE-NOT: noprofile
58 unsigned test2(void) {
59 // CHECK: %pgocount = load i64, ptr @__profc_{{_?}}test2
60 // FUNC-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test2
61 // FILE: %pgocount = load i64, ptr @__profc_{{_?}}test2
62 // SECTION: %pgocount = load i64, ptr @__profc_{{_?}}test2
63 // EXCLUDE: %pgocount = load i64, ptr @__profc_{{_?}}test2