brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · cc26e2b Raw
87 lines · c
1// RUN: rm -rf %t && split-file %s %t2 3// RUN: %clang_cc1 -fprofile-instrument=clang -fcoverage-mapping -dump-coverage-mapping -emit-llvm %t/main.c -o - | FileCheck %s4// 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=FUNC5 6// RUN: echo "src:%t/main.c" | sed -e 's/\\/\\\\/g' > %t-file.list7// 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=FILE8// RUN: %clang_cc1 -fprofile-instrument=llvm -fprofile-list=%t/section.list -emit-llvm %t/main.c -o - | FileCheck %s --check-prefix=SECTION9// 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=EXCLUDE11// 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=EXCLUDE12 13//--- func.list14fun:test115 16//--- section.list17[clang]18fun:test119[llvm]20fun:test221 22//--- cold-func.list23[sample-coldcov]24fun:test*25!fun:test226 27//--- exclude.list28fun:test*29!fun:test130 31//--- exclude-only.list32!fun:test133 34//--- main.c35unsigned i;36 37// CHECK: test138// CHECK: test239// FUNC: test140// FUNC-NOT: test241// FILE: test142// FILE: test243// EXCLUDE-NOT: test144// EXCLUDE: test245 46// CHECK-NOT: noprofile47// CHECK: @test148// FUNC-NOT: noprofile49// FUNC: @test150// FILE-NOT: noprofile51// FILE: @test152// SECTION: noprofile53// SECTION: @test154// EXCLUDE: noprofile55// EXCLUDE: @test156// COLDCOV-NOT: noprofile57// COLDCOV: @test158unsigned test1(void) {59  // CHECK: %pgocount = load i64, ptr @__profc_{{_?}}test160  // FUNC: %pgocount = load i64, ptr @__profc_{{_?}}test161  // FILE: %pgocount = load i64, ptr @__profc_{{_?}}test162  // SECTION-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test163  // EXCLUDE-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test164  return i + 1;65}66 67// CHECK-NOT: noprofile68// CHECK: @test269// FUNC: noprofile70// FUNC: @test271// FILE-NOT: noprofile72// FILE: @test273// SECTION-NOT: noprofile74// SECTION: @test275// EXCLUDE-NOT: noprofile76// EXCLUDE: @test277// COLDCOV: noprofile78// COLDCOV: @test279unsigned test2(void) {80  // CHECK: %pgocount = load i64, ptr @__profc_{{_?}}test281  // FUNC-NOT: %pgocount = load i64, ptr @__profc_{{_?}}test282  // FILE: %pgocount = load i64, ptr @__profc_{{_?}}test283  // SECTION: %pgocount = load i64, ptr @__profc_{{_?}}test284  // EXCLUDE: %pgocount = load i64, ptr @__profc_{{_?}}test285  return i - 1;86}87