2020-05-09 07:50:34 +08:00
|
|
|
// RUN: %clang -### -S -ftest-coverage %s 2>&1 | FileCheck --check-prefix=TEST-COVERAGE %s
|
|
|
|
// RUN: %clang -### -S -ftest-coverage -fno-test-coverage %s 2>&1 | FileCheck --check-prefix=NO-TEST-COVERAGE %s
|
|
|
|
|
2020-10-20 13:17:32 +08:00
|
|
|
// TEST-COVERAGE: "-ftest-coverage"
|
2020-05-09 07:50:34 +08:00
|
|
|
// TEST-COVERAGE: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.gcno"
|
|
|
|
// NO-TEST-COVERAGE-NOT: "-coverage-notes-file"
|
|
|
|
|
2020-05-09 06:04:03 +08:00
|
|
|
// RUN: %clang -### -S -fprofile-arcs %s 2>&1 | FileCheck --check-prefix=PROFILE-ARCS %s
|
|
|
|
// RUN: %clang -### -S -fprofile-arcs -fno-profile-arcs %s 2>&1 | FileCheck --check-prefix=NO-PROFILE-ARCS %s
|
|
|
|
|
2020-10-20 13:17:32 +08:00
|
|
|
// PROFILE-ARCS: "-fprofile-arcs"
|
2020-05-09 06:04:03 +08:00
|
|
|
// PROFILE-ARCS: "-coverage-notes-file" "{{.*}}{{/|\\\\}}coverage.c"
|
2020-10-20 13:17:32 +08:00
|
|
|
// NO-PROFILE-ARCS-NOT: "-ftest-coverage"
|
2020-05-09 06:04:03 +08:00
|
|
|
|
|
|
|
// RUN: %clang -### -S -fprofile-arcs %s -o /foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
|
|
|
|
// RUN: %clang_cl -### /c --coverage /Fo/foo/bar.obj -- %s 2>&1 | FileCheck --check-prefix=GCNO-LOCATION %s
|
|
|
|
// RUN: %clang -### -c -fprofile-arcs %s -o foo/bar.o 2>&1 | FileCheck --check-prefix=GCNO-LOCATION-REL %s
|
|
|
|
|
|
|
|
// GCNO-LOCATION: "-coverage-notes-file" "{{.*}}/foo/bar.gcno"
|
|
|
|
// GCNO-LOCATION-REL: "-coverage-notes-file" "{{.*}}{{/|\\\\}}foo/bar.gcno"
|
|
|
|
|
2020-05-09 07:14:41 +08:00
|
|
|
/// Don't warn -Wunused-command-line-argument.
|
|
|
|
// RUN: %clang -E -Werror --coverage -ftest-coverage -fprofile-arcs %s
|
|
|
|
|
2020-05-09 06:04:03 +08:00
|
|
|
/// Test -fprofile-dir=
|
|
|
|
// RUN: not %clang -S -Werror -fprofile-dir=abc %s
|
|
|
|
// RUN: not %clang -S -Werror -ftest-coverage -fprofile-dir=abc %s
|
|
|
|
// RUN: %clang -### -S -fprofile-arcs -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
|
|
|
|
// RUN: %clang -### -S --coverage -fprofile-dir=abc %s 2>&1 | FileCheck --check-prefix=PROFILE-DIR %s
|
|
|
|
|
|
|
|
// PROFILE-DIR: "-coverage-data-file" "abc
|
|
|
|
|
|
|
|
/// These should only get passed if any of --coverage, -ftest-coverage, or
|
|
|
|
/// -fprofile-arcs is passed.
|
|
|
|
// RUN: %clang -### -c %s 2>&1 | FileCheck --check-prefix=NO-COV %s
|
|
|
|
// NO-COV-NOT: "-coverage-notes-file"
|
|
|
|
// NO-COV-NOT: "-coverage-data-file"
|