[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / profile-filter.c
blob94024a8acbabf1d3047e32896c334c49cbc7fe5c
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
18 unsigned i;
20 // CHECK: test1
21 // CHECK: test2
22 // FUNC: test1
23 // FUNC-NOT: test2
24 // FILE: test1
25 // FILE: test2
26 // EXCLUDE-NOT: test1
27 // EXCLUDE: test2
29 // CHECK-NOT: noprofile
30 // CHECK: @test1
31 // FUNC-NOT: noprofile
32 // FUNC: @test1
33 // FILE-NOT: noprofile
34 // FILE: @test1
35 // SECTION: noprofile
36 // SECTION: @test1
37 // EXCLUDE: noprofile
38 // EXCLUDE: @test1
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
45 return i + 1;
48 // CHECK-NOT: noprofile
49 // CHECK: @test2
50 // FUNC: noprofile
51 // FUNC: @test2
52 // FILE-NOT: noprofile
53 // FILE: @test2
54 // SECTION-NOT: noprofile
55 // SECTION: @test2
56 // EXCLUDE-NOT: noprofile
57 // EXCLUDE: @test2
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
64 return i - 1;